summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosemary Sebastian <rosemaryseb8@gmail.com>2016-06-16 12:14:21 +0530
committerRosemary Sebastian <rosemaryseb8@gmail.com>2016-06-16 17:08:32 +0530
commit68a5a2baf0dce91569514edac2282d8da85fcb50 (patch)
treeba3e0ef93d5c72379b51fe7fc7158c34ed2a2ddc
parentWIP Get start and end positions of redline (diff)
downloadcore-68a5a2baf0dce91569514edac2282d8da85fcb50.tar.gz
core-68a5a2baf0dce91569514edac2282d8da85fcb50.zip
Store changed element type
Change-Id: I7ab24494e6545cd5392c4507d3b469d0e78f357c
-rw-r--r--sw/inc/unoprnms.hxx1
-rw-r--r--sw/source/core/unocore/unoredline.cxx8
-rw-r--r--xmloff/source/text/XMLRedlineExport.cxx9
-rw-r--r--xmloff/source/text/XMLRedlineExport.hxx1
4 files changed, 19 insertions, 0 deletions
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index c3e9853d9845..3683ab451f4c 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -542,6 +542,7 @@
#define UNO_NAME_IS_IN_HEADER_FOOTER "IsInHeaderFooter"
#define UNO_NAME_START "Start"
#define UNO_NAME_END "End"
+#define UNO_NAME_REDLINE_ELEMENT_TYPE "RedlineElementType"
#define UNO_NAME_START_REDLINE "StartRedline"
#define UNO_NAME_END_REDLINE "EndRedline"
#define UNO_NAME_REDLINE_START "RedlineStart"
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 367cd9aa1d75..3a93bed39bbd 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -309,6 +309,11 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co
{
aRet <<= !rRedline.IsDelLastPara();
}
+ else if (rPropertyName == UNO_NAME_REDLINE_ELEMENT_TYPE)
+ {
+ OUString sElementType = "paragraph";
+ aRet <<= sElementType;
+ }
else if (rPropertyName == UNO_NAME_START || rPropertyName == UNO_NAME_END)
{
sal_Int32 nStart(COMPLETE_STRING), nEnd(COMPLETE_STRING);
@@ -348,6 +353,9 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
pRet[nPropIdx].Name = UNO_NAME_MERGE_LAST_PARA;
pRet[nPropIdx++].Value <<= !rRedline.IsDelLastPara();
+ pRet[nPropIdx].Name = UNO_NAME_REDLINE_ELEMENT_TYPE;
+ pRet[nPropIdx++].Value <<= OUString("paragraph");
+
SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
if(pNodeIdx )
{
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index 1e3ad9fd9aea..5bc629c4206a 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -72,6 +72,7 @@ XMLRedlineExport::XMLRedlineExport(SvXMLExport& rExp)
, sRedlineSuccessorData("RedlineSuccessorData")
, sRedlineText("RedlineText")
, sRedlineType("RedlineType")
+, sRedlineElementType("RedlineElementType")
, sUnknownChange("UnknownChange")
, sStartRedline("StartRedline")
, sEndRedline("EndRedline")
@@ -338,6 +339,14 @@ void XMLRedlineExport::ExportChangedRegion(
sal_uInt16 nParagraphIdx = 2, nCharStart, nCharEnd;
rPropSet->getPropertyValue("Start") >>= nCharStart;
rPropSet->getPropertyValue("End") >>= nCharEnd;
+ aAny = rPropSet->getPropertyValue(sRedlineElementType);
+ OUString sElementType;
+ aAny >>= sElementType;
+ if( sElementType == "text" )
+ eChangeType = XML_TEXT;
+ OUString sParagraphIdx = "2", sCharStart, sCharEnd;
+ rPropSet->getPropertyValue("Start") >>= sCharStart;
+ rPropSet->getPropertyValue("End") >>= sCharEnd;
if(eChangeType == XML_PARAGRAPH)
{
rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + rtl::OUString::number(nParagraphIdx));
diff --git a/xmloff/source/text/XMLRedlineExport.hxx b/xmloff/source/text/XMLRedlineExport.hxx
index 1ece91768607..bdb571927e21 100644
--- a/xmloff/source/text/XMLRedlineExport.hxx
+++ b/xmloff/source/text/XMLRedlineExport.hxx
@@ -66,6 +66,7 @@ class XMLRedlineExport
const OUString sRedlineSuccessorData;
const OUString sRedlineText;
const OUString sRedlineType;
+ const OUString sRedlineElementType;
const OUString sRedlineUndoType;
const OUString sRedlineUndoName;
const OUString sRedlineUndoStart;