[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - sw/source xmloff/source
Rosemary Sebastian
rosemaryseb8 at gmail.com
Fri Jun 17 15:00:26 UTC 2016
sw/source/core/unocore/unoredline.cxx | 12 ++++--------
xmloff/source/text/XMLRedlineExport.cxx | 2 +-
2 files changed, 5 insertions(+), 9 deletions(-)
New commits:
commit 70c230c10ad6ba678c00cf5b61235e7c261c7393
Author: Rosemary Sebastian <rosemaryseb8 at gmail.com>
Date: Fri Jun 17 20:24:52 2016 +0530
Prevent crash
This is not the correct way to find the element type.
Hardcode the element type as "text" for now, to see the character
start and end positions in the resulting xml.
Change-Id: I254769ee922d6ecfd593e590293ee964878b0d0f
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 37743a0..b83a3ee 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -311,11 +311,7 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co
}
else if (rPropertyName == UNO_NAME_REDLINE_ELEMENT_TYPE)
{
- SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
- if ( 2 < ( pNodeIdx->GetNode().EndOfSectionIndex() - pNodeIdx->GetNode().GetIndex() ) )
- aRet <<= OUString("paragraph");
- else
- aRet <<= OUString("text");
+ aRet <<= OUString("text");
}
else if (rPropertyName == UNO_NAME_REDLINE_UNDO_START)
{
@@ -323,7 +319,7 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co
}
else if (rPropertyName == UNO_NAME_REDLINE_UNDO_END)
{
- aRet <<= rRedline.GetPoint()->nContent.GetNext()->GetIndex();
+ aRet <<= rRedline.GetPoint()->nContent.GetIndex();
}
return aRet;
}
@@ -357,13 +353,13 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
pRet[nPropIdx++].Value <<= !rRedline.IsDelLastPara();
pRet[nPropIdx].Name = UNO_NAME_REDLINE_ELEMENT_TYPE;
- pRet[nPropIdx++].Value <<= OUString("paragraph");
+ pRet[nPropIdx++].Value <<= OUString("text");
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;
+ pRet[nPropIdx++].Value <<= rRedline.GetPoint()->nContent.GetIndex() + 1;
SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
if(pNodeIdx )
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index 8459764..6d44992 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -341,7 +341,7 @@ void XMLRedlineExport::ExportChangedRegion(
rPropSet->getPropertyValue("RedlineUndoStart") >>= nCharStart;
rPropSet->getPropertyValue("RedlineUndoEnd") >>= nCharEnd;
- XMLTokenEnum eElementType = XML_PARAGRAPH;
+ XMLTokenEnum eElementType = XML_TEXT;
OUString sElementType;
aAny = rPropSet->getPropertyValue(sRedlineElementType);
aAny >>= sElementType;
More information about the Libreoffice-commits
mailing list