summaryrefslogtreecommitdiff
authorMiklos Vajna <vmiklos@suse.cz>2013-06-16 11:21:38 (GMT)
committer Miklos Vajna <vmiklos@suse.cz>2013-06-16 12:47:07 (GMT)
commitae85b56a9a18657a57fd5033faff34e7ee4ff2f8 (patch) (side-by-side diff)
treed62b2af7172b2119637a540ab448e6171aca5af3
parent01bc38ac11fe791474fdffd763534851308d86ab (diff)
downloadcore-ae85b56a9a18657a57fd5033faff34e7ee4ff2f8.zip
core-ae85b56a9a18657a57fd5033faff34e7ee4ff2f8.tar.gz
Import/export RTF_REVISIONS
File -> Properties -> Security -> Record Changes on the UI. Change-Id: I96d321f407abd33e15a4a133e6723d48efa5bc53
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--sw/qa/extras/rtfexport/data/record-changes.rtf3
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx8
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx3
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx3
4 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/record-changes.rtf b/sw/qa/extras/rtfexport/data/record-changes.rtf
new file mode 100644
index 0000000..c970891
--- a/dev/null
+++ b/sw/qa/extras/rtfexport/data/record-changes.rtf
@@ -0,0 +1,3 @@
+{\rtf1\revisions
+hello
+\par }
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 0605b82..7de0a4b 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -64,6 +64,7 @@ public:
void testHyperlink();
void testTextFrameBorders();
void testTextframeGradient();
+ void testRecordChanges();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -117,6 +118,7 @@ void Test::run()
{"hyperlink.rtf", &Test::testHyperlink},
{"textframe-borders.rtf", &Test::testTextFrameBorders},
{"textframe-gradient.rtf", &Test::testTextframeGradient},
+ {"record-changes.rtf", &Test::testRecordChanges},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -584,6 +586,12 @@ void Test::testTextframeGradient()
CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style);
}
+void Test::testRecordChanges()
+{
+ // \revisions wasn't imported/exported.
+ CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(mxComponent, "RecordChanges"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index c98b780..a766e348 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -515,6 +515,9 @@ void RtfExport::ExportDocument_Impl()
Strm() << OOO_STRING_SVTOOLS_RTF_VIEWSCALE;
OutULong(pViewShell->GetViewOptions()->GetZoom());
}
+ // Record changes?
+ if (nsRedlineMode_t::REDLINE_ON & mnRedlineMode)
+ Strm() << OOO_STRING_SVTOOLS_RTF_REVISIONS;
// Page description
WritePageDescTable();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index a2bf11e..8bd05dc 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2655,6 +2655,9 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_MNOR:
m_bMathNor = true;
break;
+ case RTF_REVISIONS:
+ m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_trackRevisions, RTFValue::Pointer_t(new RTFValue(1)));
+ break;
default:
{
SAL_INFO("writerfilter", "TODO handle flag '" << lcl_RtfToString(nKeyword) << "'");