summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-08-02 17:01:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-08-03 10:55:43 +0100
commit27c2fe405ca55a2630176a657fb4895c5e31fcea (patch)
treeac4b00a96e7882647b5cc21c0c133b2ece54d538 /sw/inc
parentab852cc0b6fe6e3a8b398b7fa0313a1425adf31b (diff)
Related: fdo#46757 extend ModelToViewHelper for more cases
beef up ModelToViewHelper to be able to optionally expand fields, collapse hidden text and collapse/expand redline deleted text Change-Id: I6d4d0969102ad9699f7fafe091b2eff6a5707bc4
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/modeltoviewhelper.hxx37
1 files changed, 35 insertions, 2 deletions
diff --git a/sw/inc/modeltoviewhelper.hxx b/sw/inc/modeltoviewhelper.hxx
index c7a80c5b4278..835044d61e3e 100644
--- a/sw/inc/modeltoviewhelper.hxx
+++ b/sw/inc/modeltoviewhelper.hxx
@@ -34,7 +34,38 @@ class SwTxtNode;
to expand the fields to get the string as it appears in the view. Two
helper functions are provided to convert model positions to view positions
and vice versa.
+
+ CH_TXTATR_BREAKWORD -> SwTxtNode will have field attributes associated with these
+ . .
+ . .
+ . .
+ AAAAA BBBBB # CCCCC # DDDDD
+ | | | |
+ | | | |
+ | ---------
+ | | .
+ | | .
+ | | .......... bounds of a hidden text character attribute
+ ------
+ .
+ .
+ .............. a range of text defined in redline region as deleted
+
+ 0000: pass through gives: AAAAA BBBBB # CCCCC # DDDDD
+ 0001: only expanding fields gives: AAAAA BBBBB foo CCCCC foo DDDDD
+ 0010: only hiding hiddens gives: AAAAA CCCCC # DDDDD
+ 0100: only hiding redlines gives: AAAABB # CCCCC # DDDDD
+ 0011: expanding fields + hiding hiddens gives: AAAAA CCCC foo DDDDD
+ 0101: expanding fields + hiding redlines gives: AAAA B foo CCCCC foo DDDDD
+ 0110: hiding hiddens + hiding redlines gives: AAAACCCC # DDDDD
+ 0111: expanding fields + hiding hiddens + hiding redlines gives: AAAABB foo CCCCC foo DDDDD
*/
+
+#define PASSTHROUGH 0x0000
+#define EXPANDFIELDS 0x0001
+#define HIDEINVISIBLE 0x0002
+#define HIDEREDLINED 0x0004
+
class ModelToViewHelper
{
/** For each field in the model string, there is an entry in the conversion
@@ -67,8 +98,10 @@ public:
ModelPosition() : mnPos(0), mnSubPos(0), mbIsField(false) {}
};
- ModelToViewHelper(const SwTxtNode &rNode);
- ModelToViewHelper() {} //pass through filter, view == model
+ ModelToViewHelper(const SwTxtNode &rNode, int eMode = EXPANDFIELDS);
+ ModelToViewHelper() //pass through filter, view == model
+ {
+ }
/** Converts a model position into a view position