summaryrefslogtreecommitdiff
path: root/editeng/inc
diff options
context:
space:
mode:
authorAttila Szűcs <attila.szucs@collabora.com>2024-01-24 12:03:28 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-16 18:10:51 +0100
commit9ed6d80622174826f8b7413529320ccd94782296 (patch)
tree4a9d4124a1535cdc619c37bb2e78edd2514d12b9 /editeng/inc
parentf5ecfd0754cef194e670d4db0fea8bbe4c6fe2c9 (diff)
tdf#154248 sd: change multiline field wrapping
Modified ImpEditEngine::CreateLines and ImpEditEngine::Paint to wrap multiline fields (hyperlinks) to wrap better: Multiline hyperlinks can start/end in the middle of a line. like this: text hyperlink-start hyperlink-line2..... hyperlink-end text Start of the lines of the multiline hyperlinks now follow the line start (for example if the 1. line has a bullet/indent, and the 2. line does not then the multiline hyperlink 2. line will start where normal 2. line would start) Changed the way how fields wrapped while editing.. (we didn't split fields into lines, when its textbox is edited, but now we do) This way it is more a WYSIWYG editor. (when we edit, we see what we will get) Changed the constant reference rLine to non-constant pointer pLine, because this hack change the actual line to the next line at the end of a muliline hyperlink, so the algotithm will continue calculating with the next line, as if it would be still the previous line. Change-Id: I2c67f4ae1b86ee9c73f01ae0c045f02e56a09c1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162503 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'editeng/inc')
-rw-r--r--editeng/inc/EditLine.hxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/editeng/inc/EditLine.hxx b/editeng/inc/EditLine.hxx
index 165f3fcf0a59..7d4a43e0e639 100644
--- a/editeng/inc/EditLine.hxx
+++ b/editeng/inc/EditLine.hxx
@@ -35,6 +35,7 @@ private:
std::vector<sal_Bool> aKashidaPositions;
sal_Int32 nTxtWidth = 0;
sal_Int32 nStartPosX = 0;
+ sal_Int32 nNextLinePosXDiff = 0;
sal_Int32 nStart = 0; // could be replaced by nStartPortion
sal_Int32 nEnd = 0; // could be replaced by nEndPortion
sal_Int32 nStartPortion = 0;
@@ -97,6 +98,8 @@ public:
sal_Int32 GetStartPosX() const { return nStartPosX; }
void SetStartPosX(sal_Int32 start);
+ sal_Int32 GetNextLinePosXDiff() const { return nNextLinePosXDiff; }
+ void SetNextLinePosXDiff(sal_Int32 diff) { nNextLinePosXDiff = diff; }
Size CalcTextSize(ParaPortion& rParaPortion);
bool IsInvalid() const { return bInvalid; }