summaryrefslogtreecommitdiff
path: root/linguistic
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 /linguistic
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 'linguistic')
-rw-r--r--linguistic/source/gciterator.cxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 73c010b6667e..6f0123025dbf 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -489,6 +489,20 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC
return xRes;
}
+static uno::Sequence<beans::PropertyValue>
+lcl_makeProperties(uno::Reference<text::XFlatParagraph> const& xFlatPara)
+{
+ uno::Sequence<beans::PropertyValue> ret(2);
+ uno::Reference<beans::XPropertySet> const xProps(
+ xFlatPara, uno::UNO_QUERY_THROW);
+ ret[0] = beans::PropertyValue("FieldPositions", -1,
+ xProps->getPropertyValue("FieldPositions"),
+ beans::PropertyState_DIRECT_VALUE);
+ ret[1] = beans::PropertyValue("FootnotePositions", -1,
+ xProps->getPropertyValue("FootnotePositions"),
+ beans::PropertyState_DIRECT_VALUE);
+ return ret;
+}
void GrammarCheckingIterator::DequeueAndCheck()
{
@@ -548,8 +562,10 @@ void GrammarCheckingIterator::DequeueAndCheck()
if (xGC.is())
{
aGuard.clear();
- uno::Sequence< beans::PropertyValue > aEmptyProps;
- aRes = xGC->doProofreading( aCurDocId, aCurTxt, aCurLocale, nStartPos, nSuggestedEnd, aEmptyProps );
+ uno::Sequence<beans::PropertyValue> const aProps(
+ lcl_makeProperties(xFlatPara));
+ aRes = xGC->doProofreading( aCurDocId, aCurTxt,
+ aCurLocale, nStartPos, nSuggestedEnd, aProps );
//!! work-around to prevent looping if the grammar checker
//!! failed to properly identify the sentence end
@@ -696,8 +712,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
sal_Int32 nEndPos = -1;
if (xGC.is())
{
- uno::Sequence< beans::PropertyValue > aEmptyProps;
- aTmpRes = xGC->doProofreading( aDocId, rText, aCurLocale, nStartPos, nSuggestedEndOfSentencePos, aEmptyProps );
+ uno::Sequence<beans::PropertyValue> const aProps(
+ lcl_makeProperties(xFlatPara));
+ aTmpRes = xGC->doProofreading( aDocId, rText,
+ aCurLocale, nStartPos, nSuggestedEndOfSentencePos, aProps );
//!! work-around to prevent looping if the grammar checker
//!! failed to properly identify the sentence end