diff options
author | Jürgen Schmidt <jsc@apache.org> | 2013-03-20 14:14:46 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-23 11:55:26 +0100 |
commit | 1959113eac6bb23310883c974ac40cba6f222493 (patch) | |
tree | 5474214954797653cb230be53dd01ed553e39d88 /sw | |
parent | 403bfea10fb8ef5c4596d6a137aa22cc5b895ccf (diff) |
Resolves: #i121730# add optional interface XRangeBasedSmartTagRecognizer
for SmartTags
Patch by: Kai Labusch
Review by: arielch, jsc
(cherry picked from commit a64c066b02924371f486688df01b6881bcd0da8b)
Conflicts:
offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl
offapi/com/sun/star/smarttags/makefile.mk
svx/inc/svx/SmartTagMgr.hxx
svx/source/smarttags/SmartTagMgr.cxx
sw/source/core/txtnode/txtedt.cxx
Change-Id: I11f528b2c1a068d0b1db1e76c2f889c0632ab972
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index e1c282452d80..1716010a78f4 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -76,6 +76,8 @@ #include <vector> #include <utility> +#include <unotextrange.hxx> + using namespace ::com::sun::star; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::i18n; @@ -1424,6 +1426,13 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/ com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xController = pNode->GetDoc()->GetDocShell()->GetController(); + SwPosition start(*pNode, nBegin); + SwPosition end (*pNode, nEnd); + Reference< ::com::sun::star::text::XTextRange > xRange = SwXTextRange::CreateXTextRange(*pNode->GetDoc(), start, &end); + + rSmartTagMgr.RecognizeTextRange(xRange, xTextMarkup, xController); + + xub_StrLen nLangBegin = nBegin; xub_StrLen nLangEnd = nEnd; @@ -1439,7 +1448,7 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/ const sal_uInt32 nExpandBegin = aConversionMap.ConvertToViewPosition( nLangBegin ); const sal_uInt32 nExpandEnd = aConversionMap.ConvertToViewPosition( nLangEnd ); - rSmartTagMgr.Recognize( aExpandText, xTextMarkup, xController, aLocale, nExpandBegin, nExpandEnd - nExpandBegin ); + rSmartTagMgr.RecognizeString(aExpandText, xTextMarkup, xController, aLocale, nExpandBegin, nExpandEnd - nExpandBegin ); nLangBegin = nLangEnd; } |