summaryrefslogtreecommitdiff
path: root/editeng/source/xml/xmltxtimp.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-03-02 20:31:48 +0100
committerEike Rathke <erack@redhat.com>2018-03-02 20:32:41 +0100
commita44e62b82c7598471da9a5254953067613806337 (patch)
tree485fa00a7b61623cf738c8b92ad9bde1964358e3 /editeng/source/xml/xmltxtimp.cxx
parentce4fc2fc08be8ea2773194e303ed42d2579e93a0 (diff)
Resolves: tdf#114675 return new EditPaM of insert position from SvxReadXML()
Change-Id: I77027d74a0addaafaf19e2c2a8e9759d560951eb
Diffstat (limited to 'editeng/source/xml/xmltxtimp.cxx')
-rw-r--r--editeng/source/xml/xmltxtimp.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx
index 7fad6fa1419d..fa7e84546609 100644
--- a/editeng/source/xml/xmltxtimp.cxx
+++ b/editeng/source/xml/xmltxtimp.cxx
@@ -138,7 +138,7 @@ SvxXMLXTextImportComponent::SvxXMLXTextImportComponent(
SvXMLImport::setTargetDocument(new SvxSimpleUnoModel);
}
-void SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& rSel )
+EditPaM SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& rSel )
{
SvxEditEngineSource aEditSource( &rEditEngine );
@@ -159,6 +159,9 @@ void SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& r
rEditEngine.InsertParaBreak( rEditEngine.CreateSelection( rSel ).Max() );
rEditEngine.InsertParaBreak( rEditEngine.CreateSelection( rSel ).Max() );
+ // Init return PaM.
+ EditPaM aPaM( rEditEngine.CreateSelection( rSel ).Max());
+
ESelection aSel(rSel.nStartPara+1, 0, rSel.nEndPara+1, 0);
uno::Reference<text::XText > xParent;
SvxUnoText* pUnoText = new SvxUnoText( &aEditSource, &aSvxXMLTextImportComponentPropertySet, xParent );
@@ -227,12 +230,16 @@ void SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& r
rEditEngine.ParaAttribsToCharAttribs( pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara - 2 ) );
rEditEngine.ConnectParagraphs( pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara - 2 ),
pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara -1 ), true );
- rEditEngine.ConnectParagraphs( pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara - 2 ),
+
+ // The final join is to be returned.
+ aPaM = rEditEngine.ConnectParagraphs( pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara - 2 ),
pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara -1 ), true );
}
catch( const uno::Exception& )
{
}
+
+ return aPaM;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */