summaryrefslogtreecommitdiff
path: root/sw/inc/modeltoviewhelper.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-04-07 23:22:22 +0200
committerMichael Stahl <mstahl@redhat.com>2014-04-08 12:12:24 +0200
commitd477ff4a81ecba8a77ead5ff1a33d3e3ceed622e (patch)
treea054daa25836403aeb8c45e1abcee5d91be10bf3 /sw/inc/modeltoviewhelper.hxx
parentbda01cf116c324e4082c7cffb156dc2d5fee9d3d (diff)
fdo#69416: make footnote positions available to XProofreader
- ModelToViewHelper: add new flag REPLACEMODE, which causes fields and footnotes to be replaced with ZWSP instead of expanding them - SwXFlatParagraph: add FootnotePositions and FieldPositions properties - GrammarCheckingIterator: invoke XProofreader::doProofreading with properties FootnotePositions and FieldPositions Change-Id: I9b66a37aac94f940546e812d8b85a35aebd8181a
Diffstat (limited to 'sw/inc/modeltoviewhelper.hxx')
-rw-r--r--sw/inc/modeltoviewhelper.hxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sw/inc/modeltoviewhelper.hxx b/sw/inc/modeltoviewhelper.hxx
index 82ec6da1833e..018b67c49faa 100644
--- a/sw/inc/modeltoviewhelper.hxx
+++ b/sw/inc/modeltoviewhelper.hxx
@@ -66,6 +66,8 @@ class SwTxtNode;
#define EXPANDFOOTNOTE 0x0002
#define HIDEINVISIBLE 0x0004
#define HIDEREDLINED 0x0008
+/// do not expand to content, but replace with ZWSP
+#define REPLACEMODE 0x0010
class ModelToViewHelper
{
@@ -77,8 +79,12 @@ class ModelToViewHelper
*/
typedef std::pair< sal_Int32 , sal_Int32 > ConversionMapEntry;
typedef std::vector< ConversionMapEntry > ConversionMap;
+ typedef std::vector<sal_Int32> Positions;
ConversionMap m_aMap;
+ /// store positions of fields and footnotes for grammar checkers
+ Positions m_FieldPositions;
+ Positions m_FootnotePositions;
OUString m_aRetText;
@@ -99,7 +105,9 @@ public:
ModelPosition() : mnPos(0), mnSubPos(0), mbIsField(false) {}
};
- ModelToViewHelper(const SwTxtNode &rNode, sal_uInt16 eMode = EXPANDFIELDS | EXPANDFOOTNOTE);
+ ModelToViewHelper(const SwTxtNode &rNode,
+ // defaults are appropriate for spell/grammar checking
+ sal_uInt16 eMode = EXPANDFIELDS | EXPANDFOOTNOTE | REPLACEMODE);
ModelToViewHelper() //pass through filter, view == model
{
}
@@ -135,6 +143,8 @@ public:
ModelPosition ConvertToModelPosition( sal_Int32 nViewPos ) const;
OUString getViewText() const { return m_aRetText; }
+ Positions const& getFieldPositions() const { return m_FieldPositions; }
+ Positions const& getFootnotePositions() const { return m_FootnotePositions;}
};
#endif