diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-02-15 13:29:04 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-02-19 08:56:54 +0000 |
commit | bfd73a7c7b8c7e87f1edafa9d8ec257bfae26a0f (patch) | |
tree | 9c43586618c2521187d1eda3b68e0835cd1df496 /sw/inc | |
parent | 81e283a8e5039ab7cd4d3f2ff9c520577a97ac03 (diff) |
fdo#60732: make callers of SwTxtNode::InsertText more robust:
Return the actually inserted string from InsertText(), so callers can
check if the insertion was actually successful.
Especially InsertHint() will likely cause problems if it cannot insert
its CH_TXTATR; also Undo objects should not Undo more than was actually
inserted.
Change-Id: I87c9ea8b226ae4a2a6c20c112da76db07051a1bf
(cherry picked from commit d47218d79a2440e71efb66b2224063801ba6623b)
Reviewed-on: https://gerrit.libreoffice.org/2180
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/ndtxt.hxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 0865fa33d059..57bca6bd53d2 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -244,7 +244,10 @@ public: virtual sal_uInt16 ResetAllAttr(); /// insert text content - void InsertText( const XubString & rStr, const SwIndex & rIdx, + /// @param rStr text to insert; in case it does not fit into the limit of + /// TXTNODE_MAX, the longest prefix that fits is inserted + /// @return the prefix of rStr that was actually inserted + OUString InsertText( const XubString & rStr, const SwIndex & rIdx, const enum IDocumentContentOperations::InsertFlags nMode = IDocumentContentOperations::INS_DEFAULT ); |