[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - sw/source xmloff/source
Rosemary Sebastian
rosemaryseb8 at gmail.com
Fri Jun 17 14:06:39 UTC 2016
sw/source/core/unocore/unoredline.cxx | 24 ++++++++++++------------
xmloff/source/text/XMLRedlineExport.cxx | 2 +-
2 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit ef1380d84b36bf0f8d8bb5b77c2eabe4a0d04f61
Author: Rosemary Sebastian <rosemaryseb8 at gmail.com>
Date: Fri Jun 17 19:32:04 2016 +0530
Get the start position of redline
Change-Id: I3fd5674b47e33f769cbb22203ab92444a1bb8d47
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 0f8d115..37743a0 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -317,15 +317,13 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co
else
aRet <<= OUString("text");
}
- else if (rPropertyName == UNO_NAME_REDLINE_UNDO_START || rPropertyName == UNO_NAME_REDLINE_UNDO_END)
+ else if (rPropertyName == UNO_NAME_REDLINE_UNDO_START)
{
- sal_Int32 nStart, nEnd;
- SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
- rRedline.CalcStartEnd(pNodeIdx->GetNode().GetIndex(), nStart, nEnd);
- if(rPropertyName == UNO_NAME_REDLINE_UNDO_START)
- aRet <<= nStart;
- else
- aRet <<= nEnd;
+ aRet <<= rRedline.GetPoint()->nContent.GetIndex() + 1;
+ }
+ else if (rPropertyName == UNO_NAME_REDLINE_UNDO_END)
+ {
+ aRet <<= rRedline.GetPoint()->nContent.GetNext()->GetIndex();
}
return aRet;
}
@@ -361,6 +359,12 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
pRet[nPropIdx].Name = UNO_NAME_REDLINE_ELEMENT_TYPE;
pRet[nPropIdx++].Value <<= OUString("paragraph");
+ pRet[nPropIdx].Name = UNO_NAME_REDLINE_UNDO_START;
+ pRet[nPropIdx++].Value <<= rRedline.GetPoint()->nContent.GetIndex() + 1;
+
+ pRet[nPropIdx].Name = UNO_NAME_REDLINE_UNDO_END;
+ pRet[nPropIdx++].Value <<= rRedline.GetMark()->nContent.GetIndex() + 1;
+
SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
if(pNodeIdx )
{
@@ -369,10 +373,6 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
uno::Reference<text::XText> xRet = new SwXRedlineText(rRedline.GetDoc(), *pNodeIdx);
pRet[nPropIdx].Name = UNO_NAME_REDLINE_TEXT;
pRet[nPropIdx++].Value <<= xRet;
- pRet[nPropIdx].Name = UNO_NAME_REDLINE_UNDO_START;
- pRet[nPropIdx++].Value <<= pNodeIdx->GetNode().GetIndex();
- pRet[nPropIdx].Name = UNO_NAME_REDLINE_UNDO_END;
- pRet[nPropIdx++].Value <<= pNodeIdx->GetNode().EndOfSectionIndex();
}
else {
OSL_FAIL("Empty section in redline portion! (end node immediately follows start node)");
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index 1d085b8..8459764 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -337,7 +337,7 @@ void XMLRedlineExport::ExportChangedRegion(
OUString sType;
aAny >>= sType;
- sal_Int16 nParagraphIdx = 2, nCharStart, nCharEnd;
+ sal_uInt32 nParagraphIdx = 2, nCharStart, nCharEnd;
rPropSet->getPropertyValue("RedlineUndoStart") >>= nCharStart;
rPropSet->getPropertyValue("RedlineUndoEnd") >>= nCharEnd;
More information about the Libreoffice-commits
mailing list