summaryrefslogtreecommitdiff
path: root/include/editeng
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2019-07-03 15:33:35 +0300
committerJustin Luth <justin_luth@sil.org>2019-07-22 06:07:29 +0200
commit82c3e68642de445064313e353812b54df76c7fe9 (patch)
treeaffbde4996b940f506cd40409fc077d095b11f01 /include/editeng
parent382aceb80d3c0f420d51762e1f88eee2334ff11b (diff)
tdf#118370 Draw: add option to consolidate multiple textObjs
This gives the user a tool to consolidate multiple textboxes into a single textbox. First the user selects a group of textframes, and then runs the consolidate text function. This will REPLACE the marked textframes with a single textbox combining all of the text. The function inspects the text fragments to see if they end in sentence-ending punctuation. If not, then the next textbox's content is appended to it instead of starting a new pargraph. It is the user's responsibility to afterwards fix up paragraphing, and set paragraph properties. The rational for this patch is to simplify making major text changes on PDFs imported into Draw, since each paragraph is currently broken into tiny character-property textbox fragments. Copy/paste from the PDF itself doesn't keep character attributes, so it is hard for a user to re-create the text. This is related to tdf#32249, but as a comment says, a better solution would be to write an entire text-focused PDF import, rather than just pick up the pieces. And I agree, but considering this simple patch took me a couple of weeks of frustration, I'm obviously not the person to do that. And since the bug has been open for 9 years, likely no one else will either. Thus, this pick-up-the-pieces tool to help the end user. This initial patch works only with textFrames, but can easily be adjusted to consolidate other HasText() SdrObjects. However, that tended to produce unexpected results, so everything other than OBJ_TEXT is explicitly excluded. (Thus general shapes with text, callouts, text-along-path etc are ignored.) Change-Id: I68a9a5b187bf320a8e671414c5cb22b07725fd52 Reviewed-on: https://gerrit.libreoffice.org/75043 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'include/editeng')
-rw-r--r--include/editeng/editeng.hxx2
-rw-r--r--include/editeng/outliner.hxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index e531b6c8d9f5..64581f930aab 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -299,7 +299,7 @@ public:
void SetText( const EditTextObject& rTextObject );
void RemoveParagraph(sal_Int32 nPara);
- void InsertParagraph(sal_Int32 nPara, const EditTextObject& rTxtObj);
+ void InsertParagraph(sal_Int32 nPara, const EditTextObject& rTxtObj, const bool bAppend = false);
void InsertParagraph(sal_Int32 nPara, const OUString& rText);
void SetText(sal_Int32 nPara, const OUString& rText);
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index cc2505202e66..9d4037d6885c 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -676,7 +676,7 @@ public:
Paragraph* Insert( const OUString& rText, sal_Int32 nAbsPos = EE_PARA_APPEND, sal_Int16 nDepth = 0 );
void SetText( const OutlinerParaObject& );
- void AddText( const OutlinerParaObject& );
+ void AddText( const OutlinerParaObject&, bool bAppend = false );
void SetText( const OUString& rText, Paragraph* pParagraph );
OUString GetText( Paragraph const * pPara, sal_Int32 nParaCount=1 ) const;