sw/inc/unoprnms.hxx | 5 +++-- sw/source/core/unocore/unomapproperties.hxx | 4 ++-- sw/source/core/unocore/unoredline.cxx | 25 +++++++++++++++++++++---- xmloff/source/text/XMLRedlineExport.cxx | 26 +++++++++++++++++++------- xmloff/source/text/XMLRedlineExport.hxx | 1 + xmloff/source/text/txtparae.cxx | 5 ++++- 6 files changed, 50 insertions(+), 16 deletions(-)
New commits: commit edd64d4304cdf6f18af08e573d0fa952391c7552 Author: Rosemary Sebastian <rosemarys...@gmail.com> Date: Fri Jun 17 01:41:44 2016 +0530 WIP Get change-tracking information Change-Id: I33982d37ec6b04c1325be5f03455df35d9eaaebe diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 3683ab4..83b0a7a 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -540,8 +540,8 @@ #define UNO_NAME_REDLINE_SUCCESSOR_DATA "RedlineSuccessorData" #define UNO_NAME_REDLINE_IDENTIFIER "RedlineIdentifier" #define UNO_NAME_IS_IN_HEADER_FOOTER "IsInHeaderFooter" -#define UNO_NAME_START "Start" -#define UNO_NAME_END "End" +#define UNO_NAME_REDLINE_UNDO_START "RedlineUndoStart" +#define UNO_NAME_REDLINE_UNDO_END "RedlineUndoEnd" #define UNO_NAME_REDLINE_ELEMENT_TYPE "RedlineElementType" #define UNO_NAME_START_REDLINE "StartRedline" #define UNO_NAME_END_REDLINE "EndRedline" diff --git a/sw/source/core/unocore/unomapproperties.hxx b/sw/source/core/unocore/unomapproperties.hxx index bc2851f..e10b7d8 100644 --- a/sw/source/core/unocore/unomapproperties.hxx +++ b/sw/source/core/unocore/unomapproperties.hxx @@ -74,8 +74,8 @@ {OUString(UNO_NAME_IS_IN_HEADER_FOOTER), 0, cppu::UnoType<bool>::get(), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\ {OUString(UNO_NAME_REDLINE_TEXT), 0, cppu::UnoType<css::text::XText>::get(), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\ {OUString(UNO_NAME_MERGE_LAST_PARA), 0, cppu::UnoType<bool>::get(), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\ - {OUString(UNO_NAME_START), 0, cppu::UnoType<bool>::get(), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\ - {OUString(UNO_NAME_END), 0, cppu::UnoType<bool>::get(), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, + {OUString(UNO_NAME_REDLINE_UNDO_START), 0, cppu::UnoType<bool>::get(), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\ + {OUString(UNO_NAME_REDLINE_UNDO_END), 0, cppu::UnoType<bool>::get(), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, #define COMMON_CRSR_PARA_PROPERTIES_FN_ONLY \ { OUString(UNO_NAME_PARA_STYLE_NAME), FN_UNO_PARA_STYLE, cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID, 0}, \ { OUString(UNO_NAME_PAGE_STYLE_NAME), FN_UNO_PAGE_STYLE, cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, \ diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index 3a93bed..0f8d115 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -311,13 +311,18 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co } else if (rPropertyName == UNO_NAME_REDLINE_ELEMENT_TYPE) { - OUString sElementType = "paragraph"; - aRet <<= sElementType; + SwNodeIndex* pNodeIdx = rRedline.GetContentIdx(); + if ( 2 < ( pNodeIdx->GetNode().EndOfSectionIndex() - pNodeIdx->GetNode().GetIndex() ) ) + aRet <<= OUString("paragraph"); + else + aRet <<= OUString("text"); } - else if (rPropertyName == UNO_NAME_START || rPropertyName == UNO_NAME_END) + else if (rPropertyName == UNO_NAME_REDLINE_UNDO_START || rPropertyName == UNO_NAME_REDLINE_UNDO_END) { - sal_Int32 nStart(COMPLETE_STRING), nEnd(COMPLETE_STRING); - if(rPropertyName == UNO_NAME_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; @@ -328,7 +333,7 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties( const SwRangeRedline& rRedline, bool bIsStart ) throw() { - uno::Sequence< beans::PropertyValue > aRet(11); + uno::Sequence< beans::PropertyValue > aRet(13); const SwRedlineData* pNext = rRedline.GetRedlineData().Next(); beans::PropertyValue* pRet = aRet.getArray(); @@ -364,6 +369,10 @@ 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 5bc629c..1d085b8 100644 --- a/xmloff/source/text/XMLRedlineExport.cxx +++ b/xmloff/source/text/XMLRedlineExport.cxx @@ -19,6 +19,7 @@ #include "XMLRedlineExport.hxx" #include <tools/debug.hxx> +#include <tools/solar.h> #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> #include <com/sun/star/beans/XPropertySet.hpp> @@ -335,19 +336,21 @@ void XMLRedlineExport::ExportChangedRegion( aAny = rPropSet->getPropertyValue(sRedlineType); OUString sType; aAny >>= sType; - XMLTokenEnum eChangeType = XML_PARAGRAPH; - sal_uInt16 nParagraphIdx = 2, nCharStart, nCharEnd; - rPropSet->getPropertyValue("Start") >>= nCharStart; - rPropSet->getPropertyValue("End") >>= nCharEnd; - aAny = rPropSet->getPropertyValue(sRedlineElementType); + + sal_Int16 nParagraphIdx = 2, nCharStart, nCharEnd; + rPropSet->getPropertyValue("RedlineUndoStart") >>= nCharStart; + rPropSet->getPropertyValue("RedlineUndoEnd") >>= nCharEnd; + + XMLTokenEnum eElementType = XML_PARAGRAPH; OUString sElementType; + aAny = rPropSet->getPropertyValue(sRedlineElementType); 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) + + if( sType == sFormat ) + eElementType = XML_FORMAT_CHANGE; + else if( sElementType == "text" ) + eElementType = XML_TEXT; + if(eElementType == XML_PARAGRAPH) { rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + rtl::OUString::number(nParagraphIdx)); rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, XML_PARAGRAPH); @@ -355,9 +358,9 @@ void XMLRedlineExport::ExportChangedRegion( else { rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + rtl::OUString::number(nParagraphIdx) + "/" + rtl::OUString::number(nCharStart)); - if( sType == sInsert ) + if( sType == sInsert || sType == sFormat ) rExport.AddAttribute(XML_NAMESPACE_C, XML_END, "/" + rtl::OUString::number(nParagraphIdx) + "/" + rtl::OUString::number(nCharEnd)); - rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, eChangeType); + rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, eElementType); } SvXMLElementExport aChange(rExport, XML_NAMESPACE_TEXT, ConvertTypeName(sType), true, true); diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index ba08a55..d64165e 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -3050,8 +3050,10 @@ void XMLTextParagraphExport::_exportTextGraphic( OUString sAutoStyle( sStyle ); sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_FRAME, rPropSet, sStyle ); if( !sAutoStyle.isEmpty() ) + { GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE_NAME, GetExport().EncodeStyleName( sAutoStyle ) ); + } addTextFrameAttributes( rPropSet, false ); // svg:transform @@ -3291,8 +3293,10 @@ bool XMLTextParagraphExport::addHyperlinkAttributes( XML_SERVER_MAP, XML_TRUE ); if( !sUStyleName.isEmpty() ) + { GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, GetExport().EncodeStyleName( sUStyleName ) ); + } if( !sVStyleName.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, @@ -3456,7 +3460,6 @@ void XMLTextParagraphExport::exportText( const OUString& rText, SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, XML_S, false, false ); - nSpaceChars = 0; } commit 68a5a2baf0dce91569514edac2282d8da85fcb50 Author: Rosemary Sebastian <rosemarys...@gmail.com> Date: Thu Jun 16 12:14:21 2016 +0530 Store changed element type Change-Id: I7ab24494e6545cd5392c4507d3b469d0e78f357c diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index c3e9853..3683ab4 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 367cd9a..3a93bed 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 1e3ad9f..5bc629c 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 1ece917..bdb5719 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits