summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosemary Sebastian <rosemary.seb8@gmail.com>2016-07-16 13:36:05 +0530
committerRosemary Sebastian <rosemary.seb8@gmail.com>2016-07-20 07:46:05 +0530
commitcc046697174c878d184e183a1aa28a1167ede6f9 (patch)
tree115a675de934d7a1aee40159f4666315cc5c1304
parentWIP Insert redline into document (diff)
downloadcore-cc046697174c878d184e183a1aa28a1167ede6f9.tar.gz
core-cc046697174c878d184e183a1aa28a1167ede6f9.zip
WIP Insert redline into document
Change-Id: I51bb9e5572b0265c41cc17ae06f26a76b584fde3
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.cxx26
-rw-r--r--xmloff/source/text/XMLTrackedChangesImportContext.cxx13
2 files changed, 11 insertions, 28 deletions
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 0767c5014e73..f95d944bc579 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -511,29 +511,8 @@ void XMLRedlineImportHelper::InsertWithinParagraph(const OUString& rParaPos, boo
{
// RedlineInfo found; now set Cursor
RedlineInfo* pInfo = aFind->second;
- if (bIsOutsideOfParagraph)
- {
- // outside of paragraph: remember SwNodeIndex
- if (bStart)
- {
- pInfo->aAnchorStart.SetAsNodeIndex(rRange);
- }
- else
- {
- pInfo->aAnchorEnd.SetAsNodeIndex(rRange);
- }
-
- // also remember that we expect an adjustment for this redline
- pInfo->bNeedsAdjustment = true;
- }
- else
- {
- // inside of a paragraph: use regular XTextRanges (bookmarks)
- if (bStart)
- pInfo->aAnchorStart.Set(rRange);
- else
- pInfo->aAnchorEnd.Set(rRange);
- }
+ pInfo->aAnchorStart.Set(rRange);
+ pInfo->aAnchorEnd.Set(rRange);
// if this Cursor was the last missing info, we insert the
// node into the document
@@ -722,7 +701,6 @@ void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo)
pRedline->SetMark();
*(pRedline->GetMark()) = *aPaM.GetMark();
}
-
// set content node (if necessary)
if (nullptr != pRedlineInfo->pContentIndex)
{
diff --git a/xmloff/source/text/XMLTrackedChangesImportContext.cxx b/xmloff/source/text/XMLTrackedChangesImportContext.cxx
index ccd3f7b39b4d..244d655e8571 100644
--- a/xmloff/source/text/XMLTrackedChangesImportContext.cxx
+++ b/xmloff/source/text/XMLTrackedChangesImportContext.cxx
@@ -108,10 +108,15 @@ SvXMLImportContext* XMLTrackedChangesImportContext::CreateChildContext(
// from the ODF 1.2 standard :
// The <text:changed-region> element has the following child elements:
// <text:deletion>, <text:format-change> and <text:insertion>.
+ OUString sChangeType;
if ( IsXMLToken( rLocalName, XML_INSERTION ) ||
IsXMLToken( rLocalName, XML_DELETION ) ||
IsXMLToken( rLocalName, XML_FORMAT_CHANGE ) )
{
+ if( rLocalName == GetXMLToken( XML_INSERTION ) )
+ sChangeType = GetXMLToken( XML_DELETION );
+ else
+ sChangeType = GetXMLToken( XML_INSERTION );
sal_Int16 nLength = xAttrList->getLength();
for( sal_Int16 i = 0; i < nLength; i++ )
{
@@ -121,7 +126,7 @@ SvXMLImportContext* XMLTrackedChangesImportContext::CreateChildContext(
const OUString sValue = xAttrList->getValueByIndex(i);
if (XML_NAMESPACE_C == nPrefix)
{
- if (IsXMLToken(sLocalName, xmloff::token::XML_START))
+ if (IsXMLToken(sLocalName, XML_START))
{
sStart = sValue.pData->buffer + 1;
if(sStart.indexOf('/') != -1)
@@ -156,12 +161,12 @@ SvXMLImportContext* XMLTrackedChangesImportContext::CreateChildContext(
}
}
}
- SetChangeInfo( rLocalName, sAuthor, sComment, sDate, sStartParaPos, sStartTextPos );
+ SetChangeInfo( sChangeType, sAuthor, sComment, sDate, sStartParaPos, sStartTextPos );
// create XMLChangeElementImportContext for all kinds of changes
pContext = new XMLChangeElementImportContext(
- GetImport(), nPrefix, rLocalName,
- IsXMLToken( rLocalName, XML_DELETION ),
+ GetImport(), nPrefix, sChangeType,
+ IsXMLToken( sChangeType, XML_DELETION ),
*this);
}
// else: it may be a text element, see below