Writer: Insert signature line at current cursor position
Change-Id: Ic7cbcd409372a2d8222f57e67e1109a74f6f5ce3 Reviewed-on: https://gerrit.libreoffice.org/57026 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
@@ -30,6 +30,8 @@
|
|||||||
#include <com/sun/star/text/TextContentAnchorType.hpp>
|
#include <com/sun/star/text/TextContentAnchorType.hpp>
|
||||||
#include <com/sun/star/text/XTextContent.hpp>
|
#include <com/sun/star/text/XTextContent.hpp>
|
||||||
#include <com/sun/star/text/XTextDocument.hpp>
|
#include <com/sun/star/text/XTextDocument.hpp>
|
||||||
|
#include <com/sun/star/text/XTextViewCursor.hpp>
|
||||||
|
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
|
||||||
|
|
||||||
using namespace css;
|
using namespace css;
|
||||||
using namespace css::uno;
|
using namespace css::uno;
|
||||||
@@ -174,11 +176,12 @@ void SignatureLineDialog::Apply()
|
|||||||
const Reference<XTextDocument> xTextDocument(m_xModel, UNO_QUERY);
|
const Reference<XTextDocument> xTextDocument(m_xModel, UNO_QUERY);
|
||||||
if (xTextDocument.is())
|
if (xTextDocument.is())
|
||||||
{
|
{
|
||||||
// Insert into document
|
Reference<XText> xText = xTextDocument->getText();
|
||||||
Reference<XTextRange> const xEnd
|
Reference<XTextContent> xTextContent(xShape, UNO_QUERY_THROW);
|
||||||
= Reference<XTextDocument>(m_xModel, UNO_QUERY)->getText()->getEnd();
|
Reference<XTextViewCursorSupplier> xViewCursorSupplier(m_xModel->getCurrentController(),
|
||||||
Reference<XTextContent> const xShapeContent(xShapeProps, UNO_QUERY);
|
UNO_QUERY_THROW);
|
||||||
xShapeContent->attach(xEnd);
|
Reference<XTextViewCursor> xCursor = xViewCursorSupplier->getViewCursor();
|
||||||
|
xText->insertTextContent(xCursor, xTextContent, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user