summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorDaniel Vogelheim <dvo@openoffice.org>2001-05-02 15:26:26 +0000
committerDaniel Vogelheim <dvo@openoffice.org>2001-05-02 15:26:26 +0000
commit93dca26e27a4bc51ac873777ef8b134283ae9f71 (patch)
tree480f337d0e10e8a9302d2377e5f8806219644125 /sw
parentbdf9f21f53e5d5aa2e105cdec4d233deec5f5e1b (diff)
added redline password protection
moved redlining enabled flag from view settings to redline element
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.cxx133
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.hxx44
-rw-r--r--sw/source/filter/xml/swxml.cxx86
-rw-r--r--sw/source/filter/xml/xmlimp.cxx38
-rw-r--r--sw/source/filter/xml/xmltexti.cxx37
-rw-r--r--sw/source/filter/xml/xmltexti.hxx10
6 files changed, 232 insertions, 116 deletions
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 33cb695e9e33..a76c00641631 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLRedlineImportHelper.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: dvo $ $Date: 2001-03-27 09:37:50 $
+ * last change: $Author: dvo $ $Date: 2001-05-02 16:26:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -114,6 +114,10 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#endif
+
using namespace ::com::sun::star;
@@ -127,6 +131,7 @@ using ::com::sun::star::text::XText;
using ::com::sun::star::text::XWordCursor;
using ::com::sun::star::lang::XUnoTunnel;
using ::com::sun::star::beans::XPropertySet;
+using ::com::sun::star::beans::XPropertySetInfo;
// collision with tools/DateTime: use UNO DateTime as util::DateTime
// using ::com::sun::star::util::DateTime;
@@ -324,22 +329,47 @@ RedlineInfo::~RedlineInfo()
XMLRedlineImportHelper::XMLRedlineImportHelper(
sal_Bool bNoRedlinesPlease,
- const Reference<XModel> & rModel,
- sal_Bool bPreserveRedlineMode) :
+ const Reference<XPropertySet> & rModel,
+ const Reference<XPropertySet> & rImportInfo ) :
sEmpty(),
sInsertion(RTL_CONSTASCII_USTRINGPARAM(sXML_insertion)),
sDeletion(RTL_CONSTASCII_USTRINGPARAM(sXML_deletion)),
sFormatChange(RTL_CONSTASCII_USTRINGPARAM(sXML_format_change)),
+ sShowChanges(RTL_CONSTASCII_USTRINGPARAM("ShowChanges")),
+ sRecordChanges(RTL_CONSTASCII_USTRINGPARAM("RecordChanges")),
+ sRedlineProtectionKey(RTL_CONSTASCII_USTRINGPARAM("RedlineProtectionKey")),
aRedlineMap(),
bIgnoreRedlines(bNoRedlinesPlease),
- bSavedRedlineMode(sal_False),
- eSavedRedlineMode(REDLINE_NONE),
- pSaveDoc(NULL)
+ xModelPropertySet(rModel),
+ xImportInfoPropertySet(rImportInfo)
{
- if (bPreserveRedlineMode)
+ // check to see if redline mode is handled outside of component
+ sal_Bool bHandleShowChanges = sal_True;
+ sal_Bool bHandleRecordChanges = sal_True;
+ if ( xImportInfoPropertySet.is() )
+ {
+ Reference<XPropertySetInfo> xInfo =
+ xImportInfoPropertySet->getPropertySetInfo();
+
+ bHandleShowChanges = ! xInfo->hasPropertyByName( sShowChanges );
+ bHandleRecordChanges = ! xInfo->hasPropertyByName( sRecordChanges );
+ }
+
+ // get redline mode
+ bShowChanges = *(sal_Bool*)
+ ( bHandleShowChanges ? xModelPropertySet : xImportInfoPropertySet )
+ ->getPropertyValue( sShowChanges ).getValue();
+ bRecordChanges = *(sal_Bool*)
+ ( bHandleRecordChanges ? xModelPropertySet : xImportInfoPropertySet )
+ ->getPropertyValue( sRecordChanges ).getValue();
+
+ // set redline mode to "don't record changes"
+ if( bHandleRecordChanges )
{
- Reference<XPropertySet> xPropertySet(rModel, UNO_QUERY);
- SaveRedlineMode(xPropertySet);
+ Any aAny;
+ sal_Bool bTmp = sal_False;
+ aAny.setValue( &bTmp, ::getBooleanCppuType() );
+ xModelPropertySet->setPropertyValue( sRecordChanges, aAny );
}
}
@@ -356,16 +386,41 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
}
aRedlineMap.clear();
- // set redline mode; first set bogus redline mode with
- // SetRedlineMode_intern(), so that the subsequent
- // SetRedlineMode() is forced to update the data structures
- if ( (NULL != pSaveDoc) && bSavedRedlineMode )
+ // set redline mode, either to info property set, or directly to
+ // the document
+ sal_Bool bHandleShowChanges = sal_True;
+ sal_Bool bHandleRecordChanges = sal_True;
+ sal_Bool bHandleProtectionKey = sal_True;
+ if ( xImportInfoPropertySet.is() )
{
- // set previous redline mode
- sal_uInt16 nRedlineMode = eSavedRedlineMode;
- pSaveDoc->SetRedlineMode_intern(~nRedlineMode);
- pSaveDoc->SetRedlineMode(nRedlineMode);
+ Reference<XPropertySetInfo> xInfo =
+ xImportInfoPropertySet->getPropertySetInfo();
+
+ bHandleShowChanges = ! xInfo->hasPropertyByName( sShowChanges );
+ bHandleRecordChanges = ! xInfo->hasPropertyByName( sRecordChanges );
+ bHandleProtectionKey = ! xInfo->hasPropertyByName( sRedlineProtectionKey );
}
+
+ // set redline mode & key
+ Any aAny;
+
+ aAny.setValue( &bShowChanges, ::getBooleanCppuType() );
+ if ( bHandleShowChanges )
+ xModelPropertySet->setPropertyValue( sShowChanges, aAny );
+ else
+ xImportInfoPropertySet->setPropertyValue( sShowChanges, aAny );
+
+ aAny.setValue( &bRecordChanges, ::getBooleanCppuType() );
+ if ( bHandleRecordChanges )
+ xModelPropertySet->setPropertyValue( sRecordChanges, aAny );
+ else
+ xImportInfoPropertySet->setPropertyValue( sRecordChanges, aAny );
+
+ aAny <<= aProtectionKey;
+ if ( bHandleProtectionKey )
+ xModelPropertySet->setPropertyValue( sRedlineProtectionKey, aAny );
+ else
+ xImportInfoPropertySet->setPropertyValue( sRedlineProtectionKey, aAny);
}
void XMLRedlineImportHelper::Add(
@@ -648,9 +703,6 @@ void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo)
pDoc->SetRedlineMode_intern(REDLINE_ON);
pDoc->AppendRedline(pRedline);
pDoc->SetRedlineMode_intern(REDLINE_NONE);
-
- // also: save document
- pSaveDoc = pDoc;
}
}
@@ -694,39 +746,18 @@ SwRedlineData* XMLRedlineImportHelper::ConvertRedline(
}
-void XMLRedlineImportHelper::SaveRedlineMode(
- const Reference<XPropertySet> & rPropertySet)
+void XMLRedlineImportHelper::SetShowChanges( sal_Bool bShow )
{
- DBG_ASSERT(rPropertySet.is(), "Expected property set");
- if (rPropertySet.is())
- {
- OUString sShowChanges(RTL_CONSTASCII_USTRINGPARAM("ShowChanges"));
- OUString sRecordChanges(RTL_CONSTASCII_USTRINGPARAM("RecordChanges"));
-
- // save show redline mode
- Any aAny = rPropertySet->getPropertyValue(sShowChanges);
- eSavedRedlineMode &= ~ (REDLINE_SHOW_INSERT|REDLINE_SHOW_DELETE);
- eSavedRedlineMode |= REDLINE_SHOW_INSERT;
- if (*(sal_Bool*)aAny.getValue())
- eSavedRedlineMode |= REDLINE_SHOW_DELETE;
-
- // save record redlines
- aAny = rPropertySet->getPropertyValue(sRecordChanges);
- eSavedRedlineMode &= ~ REDLINE_ON;
- if (*(sal_Bool*)aAny.getValue())
- eSavedRedlineMode |= REDLINE_ON;
-
- bSavedRedlineMode = sal_True;
+ bShowChanges = bShow;
+}
- // and finally, disable record redlines property
- sal_Bool bTmp = sal_False;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- rPropertySet->setPropertyValue(sRecordChanges, aAny);
- }
+void XMLRedlineImportHelper::SetRecordChanges( sal_Bool bRecord )
+{
+ bRecordChanges = bRecord;
}
-void XMLRedlineImportHelper::DontRestoreRedlineMode()
+void XMLRedlineImportHelper::SetProtectionKey(
+ const Sequence<sal_Int8> & rKey )
{
- // just pretend we didn't save any info in the first place.
- bSavedRedlineMode = sal_False;
+ aProtectionKey = rKey;
}
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.hxx b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
index 44949f71c3a8..da74c0b45bd1 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.hxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLRedlineImportHelper.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: dvo $ $Date: 2001-03-27 09:37:50 $
+ * last change: $Author: dvo $ $Date: 2001-05-02 16:26:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,6 +70,10 @@
#include <com/sun/star/uno/Reference.h>
#endif
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
+#include <com/sun/star/uno/Sequence.h>
+#endif
+
#ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_
#include <com/sun/star/util/DateTime.hpp>
#endif
@@ -102,28 +106,36 @@ class XMLRedlineImportHelper
const ::rtl::OUString sInsertion;
const ::rtl::OUString sDeletion;
const ::rtl::OUString sFormatChange;
+ const ::rtl::OUString sShowChanges;
+ const ::rtl::OUString sRecordChanges;
+ const ::rtl::OUString sRedlineProtectionKey;
RedlineMapType aRedlineMap;
- /// redline mode before the import (to be restored after import)
- sal_uInt16 eSavedRedlineMode;
- sal_Bool bSavedRedlineMode; /// validity-flag for eSavedRedlineMode
-
/// if sal_True, no redlines should be inserted into document
/// (This typically happen when a document is loaded in 'insert'-mode.)
sal_Bool bIgnoreRedlines;
- /// save the document (for destructor)
- SwDoc* pSaveDoc;
+ /// save information for saving and reconstruction of the redline mode
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> xModelPropertySet;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> xImportInfoPropertySet;
+ sal_Bool bShowChanges;
+ sal_Bool bRecordChanges;
+ ::com::sun::star::uno::Sequence<sal_Int8> aProtectionKey;
public:
XMLRedlineImportHelper(
sal_Bool bIgnoreRedlines, /// ignore redlines mode
- /// model (for saving the redline mode)
+
+ // property sets of model + import info for saving + restoring the
+ // redline mode
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & rModel,
const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel> & rModel,
- sal_Bool bPreserveRedlineMode);
+ ::com::sun::star::beans::XPropertySet> & rImportInfoSet );
virtual ~XMLRedlineImportHelper();
/// create a redline object
@@ -170,6 +182,16 @@ public:
::com::sun::star::uno::Reference<
::com::sun::star::text::XTextRange> & rRange);
+ /// set redline mode: show changes
+ void SetShowChanges( sal_Bool bShowChanges );
+
+ /// set redline mode: record changes
+ void SetRecordChanges( sal_Bool bRecordChanges );
+
+ /// set redline protection key
+ void SetProtectionKey(
+ const ::com::sun::star::uno::Sequence<sal_Int8> & rKey );
+
private:
inline sal_Bool IsReady(RedlineInfo* pRedline);
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 8229038d9ef1..4477d413d603 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swxml.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: dvo $ $Date: 2001-04-23 14:41:38 $
+ * last change: $Author: dvo $ $Date: 2001-05-02 16:26:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -421,6 +421,19 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
{ "NumberStyles", sizeof("NumberStyles")-1, 0,
&::getCppuType( (Reference<container::XNameContainer> *) 0),
beans::PropertyAttribute::MAYBEVOID, 0},
+ { "RecordChanges", sizeof("RecordChanges")-1, 0,
+ &::getBooleanCppuType(),
+ beans::PropertyAttribute::MAYBEVOID, 0 },
+ { "ShowChanges", sizeof("ShowChanges")-1, 0,
+ &::getBooleanCppuType(),
+ beans::PropertyAttribute::MAYBEVOID, 0 },
+ { "RedlineProtectionKey", sizeof("RedlineProtectionKey")-1, 0,
+#if (defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500)) || (defined(__GNUC__) && defined(__APPLE__))
+ new uno::Type(::getCppuType((Sequence<sal_Int8>*)0)),
+#else
+ &::getCppuType((Sequence<sal_Int8>*)0),
+#endif
+ beans::PropertyAttribute::MAYBEVOID, 0 },
{ NULL, 0, 0, NULL, 0, 0 }
};
uno::Reference< beans::XPropertySet > xInfoSet(
@@ -464,25 +477,15 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
OUString sProgressRange(RTL_CONSTASCII_USTRINGPARAM("ProgressRange"));
xInfoSet->setPropertyValue(sProgressRange, aProgRange);
- // filter argument to prevent multiple switching of redline mode
- OUString sPreserveRedlineMode(
- RTL_CONSTASCII_USTRINGPARAM("PreserveRedlineMode"));
- beans::PropertyValue aValue;
- aValue.Name = sPreserveRedlineMode;
- sal_Bool bTmp = sal_False;
- aValue.Value.setValue( &bTmp, ::getBooleanCppuType() );
-
// prepare filter arguments
Sequence<Any> aFilterArgs( 5 );
Any *pArgs = aFilterArgs.getArray();
*pArgs++ <<= xGraphicResolver;
*pArgs++ <<= xObjectResolver;
- *pArgs++ <<= aValue; // redline mode, as prepared above
*pArgs++ <<= xStatusIndicator;
*pArgs++ <<= xInfoSet;
Sequence<Any> aEmptyArgs( 3 );
pArgs = aEmptyArgs.getArray();
- *pArgs++ <<= aValue; // redline mode, as prepared above
*pArgs++ <<= xStatusIndicator;
*pArgs++ <<= xInfoSet;
@@ -509,6 +512,25 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
rDoc.AddLink(); // prevent deletion
sal_uInt32 nRet = 0;
+ // save redline mode into import info property set
+ Any aAny;
+ sal_Bool bTmp;
+ OUString sShowChanges( RTL_CONSTASCII_USTRINGPARAM("ShowChanges") );
+ bTmp = IsShowChanges( rDoc.GetRedlineMode() );
+ aAny.setValue( &bTmp, ::getBooleanCppuType() );
+ xInfoSet->setPropertyValue( sShowChanges, aAny );
+ OUString sRecordChanges( RTL_CONSTASCII_USTRINGPARAM("RecordChanges") );
+ bTmp = IsRedlineOn(rDoc.GetRedlineMode());
+ aAny.setValue( &bTmp, ::getBooleanCppuType() );
+ xInfoSet->setPropertyValue( sRecordChanges, aAny );
+ OUString sRedlineProtectionKey( RTL_CONSTASCII_USTRINGPARAM("RedlineProtectionKey") );
+ aAny <<= rDoc.GetRedlinePasswd();
+ xInfoSet->setPropertyValue( sRedlineProtectionKey, aAny );
+
+ // force redline mode to "none"
+ rDoc.SetRedlineMode_intern( REDLINE_NONE );
+
+
if ( NULL != pStorage )
{
// read storage streams
@@ -527,11 +549,10 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
aOpt.IsFmtsOnly(), nStyleFamilyMask, !aOpt.IsMerge(),
IsOrganizerMode() );
- // save redline mode (*after* it was set in the settings)
- // (Also pass info to components to not bother with save/restore of
- // redline mode.)
- sal_uInt16 nRedlineMode = rDoc.GetRedlineMode();
- rDoc.SetRedlineMode_intern(REDLINE_NONE);
+ // update redline view mode (was set in view settings)
+ bTmp = IsShowChanges(rDoc.GetRedlineMode());
+ aAny.setValue( &bTmp, ::getBooleanCppuType() );
+ xInfoSet->setPropertyValue( sShowChanges, aAny );
ReadThroughComponent(
pStorage, xModelComp, "styles.xml", NULL, xServiceFactory,
@@ -547,13 +568,6 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
aFilterArgs, rName, IsBlockMode(), xInsertTextRange,
aOpt.IsFmtsOnly(), nStyleFamilyMask, !aOpt.IsMerge(),
sal_False );
-
- // and restore redline mode
- // (First set bogus mode to make sure the mode in SetRedlineMode()
- // is different from it's previous mode.)
- rDoc.SetRedlineMode_intern( ~nRedlineMode );
- rDoc.SetRedlineMode( nRedlineMode );
-
}
else
{
@@ -577,6 +591,30 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
aOpt.ResetAllFmtsOnly();
+ // redline password
+ aAny = xInfoSet->getPropertyValue( sRedlineProtectionKey );
+ Sequence<sal_Int8> aKey;
+ aAny >>= aKey;
+ rDoc.SetRedlinePasswd( aKey );
+
+ // restore redline mode from import info property set
+ sal_Int16 nRedlineMode = REDLINE_SHOW_INSERT;
+ aAny = xInfoSet->getPropertyValue( sShowChanges );
+ if ( *(sal_Bool*)aAny.getValue() )
+ nRedlineMode |= REDLINE_SHOW_DELETE;
+ aAny = xInfoSet->getPropertyValue( sRecordChanges );
+ if ( *(sal_Bool*)aAny.getValue() || (aKey.getLength() > 0) )
+ nRedlineMode |= REDLINE_ON;
+ else
+ nRedlineMode |= REDLINE_NONE;
+
+ // ... restore redline mode
+ // (First set bogus mode to make sure the mode in SetRedlineMode()
+ // is different from it's previous mode.)
+ rDoc.SetRedlineMode_intern( ~nRedlineMode );
+ rDoc.SetRedlineMode( nRedlineMode );
+
+
if( pGraphicHelper )
SvXMLGraphicHelper::Destroy( pGraphicHelper );
xGraphicResolver = 0;
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 9ae643bfd5cc..164daff8a3af 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlimp.cxx,v $
*
- * $Revision: 1.34 $
+ * $Revision: 1.35 $
*
- * last change: $Author: mtg $ $Date: 2001-04-05 20:00:28 $
+ * last change: $Author: dvo $ $Date: 2001-05-02 16:26:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -761,9 +761,9 @@ void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & aViewProps)
const PropertyValue *pValue = aViewProps.getConstArray();
long nTmp;
- sal_Bool bRecordRedlineChanges = sal_False,bShowRedlineChanges = sal_False,
+ sal_Bool bShowRedlineChanges = sal_False,
bShowFooter = sal_False, bShowHeader = sal_False;
- sal_Bool bChangeShowRedline = sal_False, bChangeRecordRedline = sal_False,
+ sal_Bool bChangeShowRedline = sal_False,
bChangeFooter = sal_False, bChangeHeader = sal_False;
for (sal_Int32 i = 0; i < nCount ; i++)
@@ -793,11 +793,6 @@ void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & aViewProps)
bShowRedlineChanges = *(sal_Bool *)(pValue->Value.getValue());
bChangeShowRedline = sal_True;
}
- else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "RecordRedlineChanges" ) ) )
- {
- bRecordRedlineChanges = *(sal_Bool *)(pValue->Value.getValue());
- bChangeRecordRedline = sal_True;
- }
else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ShowHeaderWhileBrowsing" ) ) )
{
bShowHeader = *(sal_Bool *)(pValue->Value.getValue());
@@ -818,23 +813,22 @@ void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & aViewProps)
if (bChangeFooter)
pDoc->SetFootInBrowse ( bShowFooter );
- sal_uInt16 eOld = pDoc->GetRedlineMode();
if (bChangeShowRedline)
{
+/* sal_uInt16 eOld = pDoc->GetRedlineMode();
+ eOld &= ~(REDLINE_SHOW_INSERT|REDLINE_SHOW_DELETE);
+
+ // set REDLINE_SHOW_DELETE as appropriate,
+ // and always set REDLINE_SHOW_INSERT
+ eOld |= REDLINE_SHOW_INSERT;
if ( bShowRedlineChanges )
- eOld |= (REDLINE_SHOW_INSERT|REDLINE_SHOW_DELETE);
- else
- eOld &= ~(REDLINE_SHOW_INSERT|REDLINE_SHOW_INSERT);
- }
- if (bChangeRecordRedline)
- {
- if ( bRecordRedlineChanges )
- eOld |= (REDLINE_ON);
- else
- eOld &= ~(REDLINE_ON);
- }
- if (bChangeShowRedline || bChangeRecordRedline )
+ eOld |= REDLINE_SHOW_DELETE;
+
pDoc->SetRedlineMode( eOld );
+*/
+ GetTextImport()->SetShowChanges( bShowRedlineChanges );
+
+ }
}
void SwXMLImport::SetConfigurationSettings(const uno::Sequence < PropertyValue > & aConfigProps)
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index 34331374e0db..b749fdecc5b4 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmltexti.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: mib $ $Date: 2001-04-04 10:36:31 $
+ * last change: $Author: dvo $ $Date: 2001-05-02 16:26:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -166,15 +166,17 @@ static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet, sal_Int32 nHeight, sal
SwXMLTextImportHelper::SwXMLTextImportHelper(
const Reference < XModel>& rModel,
+ const Reference<XPropertySet> & rInfoSet,
sal_Bool bInsertM, sal_Bool bStylesOnlyM, sal_Bool bProgress,
sal_Bool bBlockM, sal_Bool bOrganizerM,
sal_Bool bPreserveRedlineMode ) :
XMLTextImportHelper( rModel, bInsertM, bStylesOnlyM, bProgress, bBlockM,
bOrganizerM ),
- pRedlineHelper(new XMLRedlineImportHelper(bInsertM || bBlockM, rModel,
- bPreserveRedlineMode))
-// pRedlineHelper(NULL)
+ pRedlineHelper( NULL )
{
+ Reference<XPropertySet> xDocPropSet( rModel, UNO_QUERY );
+ pRedlineHelper = new XMLRedlineImportHelper(
+ bInsertM || bBlockM, xDocPropSet, rInfoSet );
}
SwXMLTextImportHelper::~SwXMLTextImportHelper()
@@ -537,7 +539,8 @@ void SwXMLTextImportHelper::endPlugin()
XMLTextImportHelper* SwXMLImport::CreateTextImport()
{
- return new SwXMLTextImportHelper( GetModel(), IsInsertMode(),
+ return new SwXMLTextImportHelper( GetModel(), getImportInfo(),
+ IsInsertMode(),
IsStylesOnlyMode(), bShowProgress,
IsBlockMode(), IsOrganizerMode(),
bPreserveRedlineMode );
@@ -597,3 +600,25 @@ void SwXMLTextImportHelper::RedlineAdjustStartNodeCursor(
}
// else: ignore redline (wasn't added before, or no open redline ID
}
+
+void SwXMLTextImportHelper::SetShowChanges( sal_Bool bShowChanges )
+{
+ if ( NULL != pRedlineHelper )
+ pRedlineHelper->SetShowChanges( bShowChanges );
+}
+
+void SwXMLTextImportHelper::SetRecordChanges( sal_Bool bRecordChanges )
+{
+ if ( NULL != pRedlineHelper )
+ pRedlineHelper->SetRecordChanges( bRecordChanges );
+}
+
+void SwXMLTextImportHelper::SetChangesProtectionKey(
+ const Sequence<sal_Int8> & rKey )
+{
+ if ( NULL != pRedlineHelper )
+ pRedlineHelper->SetProtectionKey( rKey );
+}
+
+
+
diff --git a/sw/source/filter/xml/xmltexti.hxx b/sw/source/filter/xml/xmltexti.hxx
index 1ef35297db36..424696eaf508 100644
--- a/sw/source/filter/xml/xmltexti.hxx
+++ b/sw/source/filter/xml/xmltexti.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmltexti.hxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: dvo $ $Date: 2001-03-27 09:37:50 $
+ * last change: $Author: dvo $ $Date: 2001-05-02 16:26:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -93,6 +93,8 @@ public:
SwXMLTextImportHelper(
const ::com::sun::star::uno::Reference <
::com::sun::star::frame::XModel>& rModel,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet>& rInfoSet,
sal_Bool bInsertM, sal_Bool bStylesOnlyM, sal_Bool bProgress,
sal_Bool bBlockM, sal_Bool bOrganizerM,
sal_Bool bPreserveRedlineMode );
@@ -153,6 +155,10 @@ public:
sal_Bool bIsOutsideOfParagraph);
virtual void RedlineAdjustStartNodeCursor(
sal_Bool bStart);
+ virtual void SetShowChanges( sal_Bool bShowChanges );
+ virtual void SetRecordChanges( sal_Bool bRecordChanges );
+ virtual void SetChangesProtectionKey(
+ const ::com::sun::star::uno::Sequence<sal_Int8> & rKey );
};
#endif // _XMLTEXTI_HXX