summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-05-04 09:32:16 +0300
committerJustin Luth <justin_luth@sil.org>2020-05-05 20:35:42 +0200
commit2cdec016bc763f5fc9dede8835c8f45139e811ca (patch)
tree25462b8aa4a6c01c22c61353f413499b02e07f0e /writerfilter
parentb41b339529da0e53af6b300a3faaacd2053c85e2 (diff)
writerfilter: cleanup out-of-order xText <-> xCrsr
This looks mostly like copy/paste proliferation of a pointless test for xText after it has already been used. Since this has already been working for years, there is no point in testing if xText.is(), since it would have crashed if it wasn't during the xCrsr definition. Change-Id: I6a032c0bdc7bb587f223f191623a2e3885d444bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93412 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f385565c8429..0465981ca6ba 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -467,8 +467,7 @@ void DomainMapper_Impl::AddDummyParaForTableInSection()
{
uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
uno::Reference< text::XTextCursor > xCrsr = xTextAppend->getText()->createTextCursor();
- uno::Reference< text::XText > xText = xTextAppend->getText();
- if(xCrsr.is() && xText.is())
+ if (xCrsr.is())
{
xTextAppend->finishParagraph( uno::Sequence< beans::PropertyValue >() );
SetIsDummyParaAddedForTableInSection(true);
@@ -4828,8 +4827,7 @@ void DomainMapper_Impl::CloseFieldCommand()
if (xTextAppend.is())
{
uno::Reference< text::XTextCursor > xCrsr = xTextAppend->getText()->createTextCursor();
- uno::Reference< text::XText > xText = xTextAppend->getText();
- if(xCrsr.is() && xText.is())
+ if (xCrsr.is())
{
xCrsr->gotoEnd(false);
uno::Reference< beans::XPropertySet > xProp( xCrsr, uno::UNO_QUERY );
@@ -5410,9 +5408,9 @@ void DomainMapper_Impl::CloseFieldCommand()
if (xTextAppend.is())
{
- uno::Reference< text::XTextCursor > xCrsr = xTextAppend->getText()->createTextCursor();
uno::Reference< text::XText > xText = xTextAppend->getText();
- if(xCrsr.is() && xText.is())
+ uno::Reference< text::XTextCursor > xCrsr = xText->createTextCursor();
+ if (xCrsr.is())
{
xCrsr->gotoEnd(false);
xText->insertString(xCrsr, sSymbol, true);
@@ -5485,10 +5483,9 @@ void DomainMapper_Impl::CloseFieldCommand()
uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
if (xTextAppend.is())
{
- uno::Reference< text::XTextCursor > xCrsr = xTextAppend->getText()->createTextCursor();
-
uno::Reference< text::XText > xText = xTextAppend->getText();
- if(xCrsr.is() && xText.is())
+ uno::Reference< text::XTextCursor > xCrsr = xText->createTextCursor();
+ if (xCrsr.is())
{
xCrsr->gotoEnd(false);
xText->insertTextContent(uno::Reference< text::XTextRange >( xCrsr, uno::UNO_QUERY_THROW ), xToInsert, false);