summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-05-03 12:25:00 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-06-08 21:51:20 +0200
commit9a9f2bab54e9f124c19b525061fafb6d48e471a0 (patch)
treee942dfedbba06bfa9bea1d6983d4d249a5f940c2 /sw/source
parentc5abcfdf0c2e98c8f3445a92dd2d71eab23a7268 (diff)
sw_redlinehide: more SwTextFrame::GetTextNode() alternatives
GetTextNode() is ambiguous and needs to be removed. Change-Id: I4145492b464870e5879427c6761a3f8e56e793cd
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/inc/txtfrm.hxx8
-rw-r--r--sw/source/core/text/txtfrm.cxx33
2 files changed, 40 insertions, 1 deletions
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 28eb82292053..de4261c7d35c 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -331,10 +331,18 @@ public:
/// Returns the text portion we want to edit (for inline see underneath)
const OUString& GetText() const;
+ // TODO: remove GetTextNode
SwTextNode *GetTextNode()
{ return static_cast< SwTextNode* >( SwContentFrame::GetNode()); }
const SwTextNode *GetTextNode() const
{ return static_cast< const SwTextNode* >( SwContentFrame::GetNode()); }
+ SwTextNode const* GetTextNodeForParaProps() const;
+ SwTextNode * GetTextNodeFirst()
+ { return const_cast<SwTextNode*>(const_cast<SwTextFrame const*>(this)->GetTextNodeFirst()); };
+ SwTextNode const* GetTextNodeFirst() const;
+ SwDoc & GetDoc()
+ { return const_cast<SwDoc &>(const_cast<SwTextFrame const*>(this)->GetDoc()); }
+ SwDoc const& GetDoc() const;
SwTextFrame(SwTextNode * const, SwFrame* );
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 22aa74ca0b32..1a3e793fc891 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -510,7 +510,38 @@ TextFrameIndex SwTextFrame::MapModelToViewPos(SwPosition const& rPos) const
const OUString& SwTextFrame::GetText() const
{
- return GetTextNode()->GetText();
+ // FIXME can GetPara be 0 ?
+ assert(GetPara());
+ sw::MergedPara const*const pMerged(GetPara()->GetMergedPara());
+ if (pMerged)
+ return pMerged->mergedText;
+ else
+ return static_cast<SwTextNode const*>(SwFrame::GetDep())->GetText();
+}
+
+SwTextNode const* SwTextFrame::GetTextNodeForParaProps() const
+{
+ assert(GetPara());
+ sw::MergedPara const*const pMerged(GetPara()->GetMergedPara());
+ if (pMerged)
+ return pMerged->pParaPropsNode;
+ else
+ return static_cast<SwTextNode const*>(SwFrame::GetDep());
+}
+
+SwTextNode const* SwTextFrame::GetTextNodeFirst() const
+{
+ assert(GetPara());
+ sw::MergedPara const*const pMerged(GetPara()->GetMergedPara());
+ if (pMerged)
+ return pMerged->pFirstNode;
+ else
+ return static_cast<SwTextNode const*>(SwFrame::GetDep());
+}
+
+SwDoc const& SwTextFrame::GetDoc() const
+{
+ return *GetTextNodeFirst()->GetDoc();
}
void SwTextFrame::ResetPreps()