diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-11-28 11:59:00 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-11-28 21:33:54 +0100 |
commit | 232ad2f2588beff50cb5c1f3b689c581ba317583 (patch) | |
tree | 40f7ebd9203de3e679b3578a552e28c7a2f09ee3 /offapi | |
parent | 85693bffad5c863e5cd4d4b3664856a9fec607d5 (diff) |
API CHANGE: add a "position" parameter to XParagraph/TextPortionAppend methods
So we can use the new RTF import for clipboard pastes in Writer without
inserting text content to the end of the document only.
Notes:
- SwXText::insertTextPortion: the MovePara() call is removed, as all it did was
trying to move the cursor beyond the end of the document.
- SwRTFReader::Read: the double fake paragraph insertion / deletion is
motivated by the ODT filter.
- RtfFilter::filter: if TextInsertModeRange is not passed, then the behaviour
is not changed.
v2:
- added missing @since tags
- added insertTextContentWithProperties() method
- removed unused appendParagraph() method
Change-Id: I24cddb00a78e3b798e7d88764e59e6a77a6e98a4
Helped-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'offapi')
-rw-r--r-- | offapi/com/sun/star/text/XParagraphAppend.idl | 21 | ||||
-rw-r--r-- | offapi/com/sun/star/text/XTextContentAppend.idl | 21 | ||||
-rw-r--r-- | offapi/com/sun/star/text/XTextPortionAppend.idl | 25 |
3 files changed, 60 insertions, 7 deletions
diff --git a/offapi/com/sun/star/text/XParagraphAppend.idl b/offapi/com/sun/star/text/XParagraphAppend.idl index 9c2ce13ec87b..343ca9eede29 100644 --- a/offapi/com/sun/star/text/XParagraphAppend.idl +++ b/offapi/com/sun/star/text/XParagraphAppend.idl @@ -35,20 +35,21 @@ */ interface XParagraphAppend : com::sun::star::uno::XInterface { - /** appends a new and empty paragraph at the end of the text. + /** appends a new and empty paragraph at the end of the text. - <p>The properties are applied to the new paragraph. - </p> + <p>The properties are applied to the last paragraph before the new paragraph is inserted. + </p> @param CharacterAndParagraphProperties can contain all the properties defined by the service <type scope="com::sun::star::text">Paragraph. - */ - com::sun::star::text::XTextRange appendParagraph( [in] com::sun::star::beans::PropertyValues CharacterAndParagraphProperties ) + */ + com::sun::star::text::XTextRange finishParagraph( [in] com::sun::star::beans::PropertyValues CharacterAndParagraphProperties ) raises( com::sun::star::lang::IllegalArgumentException, com::sun::star::beans::UnknownPropertyException ); - /** appends a new and empty paragraph at the end of the text. + + /** inserts a new and empty paragraph to the text at a given position. <p>The properties are applied to the last paragraph before the new paragraph is inserted. </p> @@ -57,8 +58,14 @@ interface XParagraphAppend : com::sun::star::uno::XInterface CharacterAndParagraphProperties can contain all the properties defined by the service <type scope="com::sun::star::text">Paragraph. + @param + TextRange specifies the position of the insertion. + + @since LibreOffice 4.0 + */ - com::sun::star::text::XTextRange finishParagraph( [in] com::sun::star::beans::PropertyValues CharacterAndParagraphProperties ) + com::sun::star::text::XTextRange finishParagraphInsert( [in] com::sun::star::beans::PropertyValues CharacterAndParagraphProperties, + [in] com::sun::star::text::XTextRange TextRange ) raises( com::sun::star::lang::IllegalArgumentException, com::sun::star::beans::UnknownPropertyException ); diff --git a/offapi/com/sun/star/text/XTextContentAppend.idl b/offapi/com/sun/star/text/XTextContentAppend.idl index 0e9c46d33073..afac7ab3b76d 100644 --- a/offapi/com/sun/star/text/XTextContentAppend.idl +++ b/offapi/com/sun/star/text/XTextContentAppend.idl @@ -55,6 +55,27 @@ interface XTextContentAppend : com::sun::star::uno::XInterface raises( com::sun::star::lang::IllegalArgumentException, com::sun::star::beans::UnknownPropertyException ); + /** inserts a text content at the given position. + + @param TextContent + contains the object to be inserted. + @param CharacterAndParagraphProperties + can contain all the properties defined by the service + <type scope="com::sun::star::text">Paragraph. + @param TextRange + insert position + @return + the anchor text range of the inserted text content. + + @since LibreOffice 4.0 + */ + com::sun::star::text::XTextRange insertTextContentWithProperties( + [in] com::sun::star::text::XTextContent TextContent, + [in] com::sun::star::beans::PropertyValues CharacterAndParagraphProperties, + [in] com::sun::star::text::XTextRange TextRange ) + raises( com::sun::star::lang::IllegalArgumentException, + com::sun::star::beans::UnknownPropertyException ); + }; diff --git a/offapi/com/sun/star/text/XTextPortionAppend.idl b/offapi/com/sun/star/text/XTextPortionAppend.idl index a1aaf5872e40..3c6c478efa93 100644 --- a/offapi/com/sun/star/text/XTextPortionAppend.idl +++ b/offapi/com/sun/star/text/XTextPortionAppend.idl @@ -53,6 +53,31 @@ interface XTextPortionAppend : com::sun::star::uno::XInterface raises( com::sun::star::lang::IllegalArgumentException, com::sun::star::beans::UnknownPropertyException ); + /** inserts a new text portion to the paragraph at a given position. + + <p> The sequence can contain all the properties defined by the service <type scope="com::sun::star::text">TextPortion. + </p> + + @param + Text contains the text to be inserted. + + @param + CharacterAndParagraphProperties can contain all the properties defined by the service + <type scope="com::sun::star::text">Paragraph. + + @param + TextRange specifies the position of the insert. + + @since LibreOffice 4.0 + + */ + com::sun::star::text::XTextRange insertTextPortion( + [in] string Text, + [in] com::sun::star::beans::PropertyValues CharacterAndParagraphProperties, + [in] com::sun::star::text::XTextRange TextRange) + raises( com::sun::star::lang::IllegalArgumentException, + com::sun::star::beans::UnknownPropertyException ); + }; |