Kaydet (Commit) ce9ccf32 authored tarafından Daniel Vogelheim's avatar Daniel Vogelheim

#96530# import/export of redlines that are contained in end nodes

üst 626dde6e
......@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexTOCContext.cxx,v $
*
* $Revision: 1.11 $
* $Revision: 1.12 $
*
* last change: $Author: dvo $ $Date: 2001-11-30 17:43:02 $
* last change: $Author: dvo $ $Date: 2002-03-25 15:58:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -405,6 +405,9 @@ void XMLIndexTOCContext::EndElement()
rHelper->GetCursor()->goRight(1, sal_True);
rHelper->GetText()->insertString(rHelper->GetCursorAsRange(),
sEmpty, sal_True);
// check for Redlines on our end node
GetImport().GetTextImport()->RedlineAdjustStartNodeCursor(sal_False);
}
}
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: XMLRedlineExport.cxx,v $
*
* $Revision: 1.12 $
* $Revision: 1.13 $
*
* last change: $Author: dvo $ $Date: 2001-11-30 17:43:02 $
* last change: $Author: dvo $ $Date: 2002-03-25 15:58:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -79,6 +79,10 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#endif
#ifndef _COM_SUN_STAR_BEANS_UNKNOWNPROPERTYEXCEPTION_HPP_
#include <com/sun/star/beans/UnknownPropertyException.hpp>
#endif
#ifndef _COM_SUN_STAR_CONTAINER_XENUMERATIONACCESS_HPP_
#include <com/sun/star/container/XEnumerationAccess.hpp>
#endif
......@@ -129,6 +133,7 @@ using namespace ::xmloff::token;
using ::com::sun::star::beans::PropertyValue;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::beans::UnknownPropertyException;
using ::com::sun::star::document::XRedlinesSupplier;
using ::com::sun::star::container::XEnumerationAccess;
using ::com::sun::star::container::XEnumeration;
......@@ -640,9 +645,21 @@ void XMLRedlineExport::ExportStartOrEndRedline(
const Reference<XPropertySet> & rPropSet,
sal_Bool bStart)
{
if( ! rPropSet.is() )
return;
// get appropriate (start or end) property
Any aAny =
rPropSet->getPropertyValue(bStart ? sStartRedline : sEndRedline);
Any aAny;
try
{
aAny = rPropSet->getPropertyValue(bStart ? sStartRedline : sEndRedline);
}
catch( UnknownPropertyException e )
{
// If we don't have the property, there's nothing to do.
return;
}
Sequence<PropertyValue> aValues;
aAny >>= aValues;
const PropertyValue* pValues = aValues.getConstArray();
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: XMLSectionImportContext.cxx,v $
*
* $Revision: 1.17 $
* $Revision: 1.18 $
*
* last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $
* last change: $Author: dvo $ $Date: 2002-03-25 15:58:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -401,6 +401,9 @@ void XMLSectionImportContext::EndElement()
rHelper->GetCursor()->goRight(1, sal_True);
rHelper->GetText()->insertString(rHelper->GetCursorAsRange(),
sEmpty, sal_True);
// check for redlines to our endnode
rHelper->RedlineAdjustStartNodeCursor(sal_False);
}
SvXMLImportContext* XMLSectionImportContext::CreateChildContext(
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: txtparae.cxx,v $
*
* $Revision: 1.101 $
* $Revision: 1.102 $
*
* last change: $Author: dvo $ $Date: 2002-03-01 10:03:41 $
* last change: $Author: dvo $ $Date: 2002-03-25 15:58:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -1479,8 +1479,15 @@ void XMLTextParagraphExport::exportText(
}
}
}
// #96530# Export redlines at start & end of XText before & after
// exporting the text content enumeration
if( !bAutoStyles && (pRedlineExport != NULL) )
pRedlineExport->ExportStartOrEndRedline( xPropertySet, sal_True );
exportTextContentEnumeration( xParaEnum, bAutoStyles, xBaseSection,
bProgress, bExportParagraph, 0, bExportLevels );
if( !bAutoStyles && (pRedlineExport != NULL) )
pRedlineExport->ExportStartOrEndRedline( xPropertySet, sal_False );
}
void XMLTextParagraphExport::exportText(
......@@ -1495,8 +1502,23 @@ void XMLTextParagraphExport::exportText(
// is added
Reference < XEnumerationAccess > xEA( rText, UNO_QUERY );
Reference < XEnumeration > xParaEnum = xEA->createEnumeration();
// #98165# don't continue without a paragraph enumeration
if( ! xParaEnum.is() )
return;
// #96530# Export redlines at start & end of XText before & after
// exporting the text content enumeration
Reference<XPropertySet> xPropertySet;
if( !bAutoStyles && (pRedlineExport != NULL) )
{
xPropertySet = Reference<XPropertySet>::query( rText );
pRedlineExport->ExportStartOrEndRedline( xPropertySet, sal_True );
}
exportTextContentEnumeration( xParaEnum, bAutoStyles, rBaseSection,
bProgress, bExportParagraph );
if( !bAutoStyles && (pRedlineExport != NULL) )
pRedlineExport->ExportStartOrEndRedline( xPropertySet, sal_False );
}
sal_Bool XMLTextParagraphExport::exportTextContentEnumeration(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment