summaryrefslogtreecommitdiff
path: root/sw/source/filter/rtf
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-10-30 12:36:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-31 12:29:49 +0100
commit0f57a02c5aabbc09cfd6c912d211d21a748abc88 (patch)
treeee00de3806b353046c63c47b5ae986df00c30e46 /sw/source/filter/rtf
parent6baffb816eb2b5b4223059c3bfadb8d3d8cac7d0 (diff)
tdf#126788 return concrete type from CreateXTextRange
to make it easier to optimise call sites unnecessarily creates tons of these Change-Id: I39bced82ae03fe33dbf0592f384332ab49f914fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142036 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/rtf')
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index c5eb1ae6e8ea..0f0af73b2c95 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -59,7 +59,7 @@ ErrCode SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rPam
// We want to work in an empty paragraph.
// Step 1: XTextRange will be updated when content is inserted, so we know
// the end position.
- const uno::Reference<text::XTextRange> xInsertPosition
+ const rtl::Reference<SwXTextRange> xInsertPosition
= SwXTextRange::CreateXTextRange(rDoc, *rPam.GetPoint(), nullptr);
auto pSttNdIdx = std::make_shared<SwNodeIndex>(rDoc.GetNodes());
const SwPosition* pPos = rPam.GetPoint();
@@ -89,7 +89,7 @@ ErrCode SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rPam
uno::Reference<lang::XComponent> xDstDoc(pDocShell->GetModel(), uno::UNO_QUERY_THROW);
xImporter->setTargetDocument(xDstDoc);
- const uno::Reference<text::XTextRange> xInsertTextRange
+ const rtl::Reference<SwXTextRange> xInsertTextRange
= SwXTextRange::CreateXTextRange(rDoc, *rPam.GetPoint(), nullptr);
uno::Reference<document::XFilter> xFilter(xInterface, uno::UNO_QUERY_THROW);
@@ -97,7 +97,8 @@ ErrCode SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rPam
{ { "InputStream",
uno::Any(uno::Reference<io::XStream>(new utl::OStreamWrapper(*m_pStream))) },
{ "InsertMode", uno::Any(true) },
- { "TextInsertModeRange", uno::Any(xInsertTextRange) } }));
+ { "TextInsertModeRange",
+ uno::Any(uno::Reference<text::XTextRange>(xInsertTextRange)) } }));
auto ret = ERRCODE_NONE;
try
{