diff options
author | Oliver-Rainer Wittmann <orw@apache.org> | 2014-06-16 12:01:46 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-17 10:57:55 +0100 |
commit | 41d43bc95b64e1907709141fcd8b6ce08b0841c8 (patch) | |
tree | 8192f2e1b29c70926b0682dc64705ee3c1ab4c80 /sw/source/core/txtnode/atrfld.cxx | |
parent | d801926e0ad2ee64c41208b5ab5984d9dc5248f0 (diff) |
Resolves: #i125086# correct implementation of css::text::XTextField...
in Writer to reflect changes made for the in-place editing of Input Fields
(cherry picked from commit 90b633455a6e54300330e68e71e22e729b445f31)
Conflicts:
sw/source/core/txtnode/atrfld.cxx
sw/source/core/unocore/unofield.cxx
Change-Id: I39de2b5074c2e7d8671ad2c0a3c01a29ccfc7882
Diffstat (limited to 'sw/source/core/txtnode/atrfld.cxx')
-rw-r--r-- | sw/source/core/txtnode/atrfld.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index e533eb54e8cd..dc7bc1dfd9cb 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -434,6 +434,40 @@ void SwTxtFld::NotifyContentChange(SwFmtFld& rFmtFld) } } +/*static*/ +void SwTxtFld::GetPamForTxtFld( + const SwTxtFld& rTxtFld, + boost::shared_ptr< SwPaM >& rPamForTxtFld ) +{ + if (rTxtFld.GetpTxtNode() == NULL) + { + SAL_WARN("sw.core", "<SwTxtFld::GetPamForField> - missing <SwTxtNode>"); + return; + } + + const SwTxtNode& rTxtNode = rTxtFld.GetTxtNode(); + + rPamForTxtFld.reset( new SwPaM( rTxtNode, + ( (rTxtFld.End() != NULL) ? *(rTxtFld.End()) : ( *(rTxtFld.GetStart()) + 1 ) ), + rTxtNode, + *(rTxtFld.GetStart()) ) ); + +} + +/*static*/ +void SwTxtFld::DeleteTxtFld( const SwTxtFld& rTxtFld ) +{ + if (rTxtFld.GetpTxtNode() != NULL) + { + boost::shared_ptr< SwPaM > pPamForTxtFld; + GetPamForTxtFld(rTxtFld, pPamForTxtFld); + if (pPamForTxtFld.get() != NULL) + { + rTxtFld.GetTxtNode().GetDoc()->DeleteAndJoin(*pPamForTxtFld); + } + } +} + // input field in-place editing SwTxtInputFld::SwTxtInputFld( SwFmtFld & rAttr, |