[Libreoffice-commits] core.git: Branch 'feature/change-tracking' - 3 commits - include/xmloff sw/source xmloff/source
Rosemary Sebastian
rosemary.seb8 at gmail.com
Thu Dec 8 07:09:13 UTC 2016
include/xmloff/xmlnmspe.hxx | 14 +++++++-------
include/xmloff/xmltoken.hxx | 6 ++++--
sw/source/filter/xml/xmlexp.cxx | 9 +++++----
sw/source/filter/xml/xmlfmte.cxx | 1 +
xmloff/source/core/xmlexp.cxx | 6 ++++--
xmloff/source/core/xmltoken.cxx | 6 ++++--
xmloff/source/text/XMLRedlineExport.cxx | 8 ++++----
7 files changed, 29 insertions(+), 21 deletions(-)
New commits:
commit 58da3ee237b7f203c4e54f756ee9d620bd8316c3
Author: Rosemary Sebastian <rosemary.seb8 at gmail.com>
Date: Tue Oct 25 08:13:44 2016 +0530
Create a new namespace URL for attributes
The prefix "c" stands for changes or collaboration.
The URL is that of the OASIS subcommittee, which is
xmlns:c="https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office-collab"
Change-Id: I54d813588910bc2ea324873c8b41977e7ad6340c
diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx
index ae588d2..73dfb10 100644
--- a/include/xmloff/xmlnmspe.hxx
+++ b/include/xmloff/xmlnmspe.hxx
@@ -83,8 +83,9 @@ XML_NAMESPACE_EXT( CHART, 39U )
XML_NAMESPACE_EXT( DRAW, 40U )
XML_NAMESPACE_EXT( CALC, 41U )
XML_NAMESPACE_EXT( LO, 42U )
+XML_NAMESPACE_EXT( C, 43U )
-#define XML_OLD_NAMESPACE_BASE 43U
+#define XML_OLD_NAMESPACE_BASE 44U
// namespaces used in the technical preview (SO 5.2)
XML_OLD_NAMESPACE( FO, 0U )
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 4ddc061..66076a7 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -156,6 +156,10 @@ namespace xmloff { namespace token {
XML_NP_LO_EXT,
XML_N_LO_EXT,
+ // change-tracking
+ XML_NP_C_EXT,
+ XML_N_C_EXT,
+
// units
XML_UNIT_MM,
XML_UNIT_M,
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 059bbd0..670eb0e 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -333,7 +333,7 @@ void SvXMLExport::InitCtor_()
}
// namespaces for documents
- if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) )
+ if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::UNDO) )
{
mpNamespaceMap->Add( GetXMLToken(XML_NP_DC), GetXMLToken(XML_N_DC), XML_NAMESPACE_DC );
mpNamespaceMap->Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT );
@@ -359,6 +359,9 @@ void SvXMLExport::InitCtor_()
mpNamespaceMap->Add(
GetXMLToken(XML_NP_LO_EXT), GetXMLToken(XML_N_LO_EXT),
XML_NAMESPACE_LO_EXT);
+ mpNamespaceMap->Add(
+ GetXMLToken(XML_NP_C_EXT), GetXMLToken(XML_N_C_EXT),
+ XML_NAMESPACE_C_EXT);
mpNamespaceMap->Add( GetXMLToken(XML_NP_FIELD), GetXMLToken(XML_N_FIELD), XML_NAMESPACE_FIELD );
}
}
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 50920fd..9cc7f52 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -158,6 +158,10 @@ namespace xmloff { namespace token {
TOKEN( "loext", XML_NP_LO_EXT ),
TOKEN( "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0", XML_N_LO_EXT ),
+ // change-tracking
+ TOKEN( "c", XML_NP_C_EXT ),
+ TOKEN( "https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office-collab", XML_N_C_EXT ),
+
// units
TOKEN( "mm", XML_UNIT_MM ),
TOKEN( "m", XML_UNIT_M ),
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index 3f24dda..91d962f 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -164,14 +164,14 @@ void XMLRedlineExport::ExportUndoChangedRegion(
if( sUndoType == "paragraph" )
{
nParaIdx++;
- rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + rtl::OUString::number(nParaIdx));
+ rExport.AddAttribute(XML_NAMESPACE_C_EXT, XML_START, "/" + rtl::OUString::number(nParaIdx));
rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, XML_PARAGRAPH);
}
else
{
- rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + rtl::OUString::number(nParaIdx) + "/" + rtl::OUString::number(nCharStart));
+ rExport.AddAttribute(XML_NAMESPACE_C_EXT, XML_START, "/" + rtl::OUString::number(nParaIdx) + "/" + rtl::OUString::number(nCharStart));
if( sType == sInsert || sType == sFormat )
- rExport.AddAttribute(XML_NAMESPACE_C, XML_END, "/" + rtl::OUString::number(nParaIdx) + "/" + rtl::OUString::number(nCharEnd));
+ rExport.AddAttribute(XML_NAMESPACE_C_EXT, XML_END, "/" + rtl::OUString::number(nParaIdx) + "/" + rtl::OUString::number(nCharEnd));
else
rExport.GetTextParagraphExport()->setTextDelCount( rExport.GetTextParagraphExport()->getTextDelCount() + nCharEnd - nCharStart + 1 );
if( sType == sFormat )
commit 00c89602429f14c7027cec87ef3258ac41ef0a11
Author: Rosemary Sebastian <rosemary.seb8 at gmail.com>
Date: Wed Oct 26 14:16:49 2016 +0530
Revert "Rework the placeholder XML"
This reverts commit baf57f89f63d24aa4592ed52c6cc9236fcde6635.
A better commit has been pushed.
Change-Id: I1859a9675c63b5699d419477d8d73663be6acaa9
diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx
index e0cf19d..ae588d2 100644
--- a/include/xmloff/xmlnmspe.hxx
+++ b/include/xmloff/xmlnmspe.hxx
@@ -70,7 +70,6 @@ XML_NAMESPACE( REPORT, 33U )
XML_NAMESPACE( OF, 34U ) // OpenFormula aka ODFF
XML_NAMESPACE( XHTML, 35U )
XML_NAMESPACE( GRDDL, 36U )
-XML_NAMESPACE( C, 37U )
// namespaces for odf extended formats
@@ -78,14 +77,14 @@ XML_NAMESPACE( C, 37U )
const sal_uInt16 XML_NAMESPACE_##prefix##_EXT = key; \
const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX = key;
-XML_NAMESPACE_EXT( OFFICE, 38U )
-XML_NAMESPACE_EXT( TABLE, 39U )
-XML_NAMESPACE_EXT( CHART, 40U )
-XML_NAMESPACE_EXT( DRAW, 41U )
-XML_NAMESPACE_EXT( CALC, 42U )
-XML_NAMESPACE_EXT( LO, 43U )
+XML_NAMESPACE_EXT( OFFICE, 37U )
+XML_NAMESPACE_EXT( TABLE, 38U )
+XML_NAMESPACE_EXT( CHART, 39U )
+XML_NAMESPACE_EXT( DRAW, 40U )
+XML_NAMESPACE_EXT( CALC, 41U )
+XML_NAMESPACE_EXT( LO, 42U )
-#define XML_OLD_NAMESPACE_BASE 44U
+#define XML_OLD_NAMESPACE_BASE 43U
// namespaces used in the technical preview (SO 5.2)
XML_OLD_NAMESPACE( FO, 0U )
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 425580d..4ddc061 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -99,8 +99,6 @@ namespace xmloff { namespace token {
XML_N_XLINK_OLD,
XML_NP_DC,
XML_N_DC,
- XML_NP_C,
- XML_N_C,
XML_NP_SVG,
XML_N_SVG,
XML_NP_FORM,
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index fe7e42b..69c0b87 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -575,7 +575,7 @@ com_sun_star_comp_Writer_XMLUndoExporter_get_implementation(css::uno::XComponent
css::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new SwXMLExport(context, OUString("com.sun.star.comp.Writer.XMLUndoExporter"),
- SvXMLExportFlags::UNDO));
+ SvXMLExportFlags::UNDO | SvXMLExportFlags::AUTOSTYLES));
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
@@ -625,7 +625,7 @@ com_sun_star_comp_Writer_XMLOasisUndoExporter_get_implementation(css::uno::XComp
css::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new SwXMLExport(context, OUString("com.sun.star.comp.Writer.XMLOasisUndoExporter"),
- SvXMLExportFlags::UNDO | SvXMLExportFlags::OASIS));
+ SvXMLExportFlags::UNDO | SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::OASIS));
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index f2b20df..059bbd0 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -333,7 +333,7 @@ void SvXMLExport::InitCtor_()
}
// namespaces for documents
- if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT| SvXMLExportFlags::UNDO) )
+ if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) )
{
mpNamespaceMap->Add( GetXMLToken(XML_NP_DC), GetXMLToken(XML_N_DC), XML_NAMESPACE_DC );
mpNamespaceMap->Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT );
@@ -347,7 +347,6 @@ void SvXMLExport::InitCtor_()
mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOW), GetXMLToken(XML_N_OOOW), XML_NAMESPACE_OOOW );
mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOC), GetXMLToken(XML_N_OOOC), XML_NAMESPACE_OOOC );
mpNamespaceMap->Add( GetXMLToken(XML_NP_OF), GetXMLToken(XML_N_OF), XML_NAMESPACE_OF );
- mpNamespaceMap->Add( GetXMLToken(XML_NP_C), GetXMLToken(XML_N_C), XML_NAMESPACE_C );
if (getDefaultVersion() > SvtSaveOptions::ODFVER_012)
{
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 1d30c0f..50920fd 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -104,8 +104,6 @@ namespace xmloff { namespace token {
TOKEN( "http://www.w3.org/1999/xlink/namespace", XML_N_XLINK_OLD ),
TOKEN( "dc", XML_NP_DC ),
TOKEN( "http://purl.org/dc/elements/1.1/", XML_N_DC ),
- TOKEN( "c", XML_NP_C ),
- TOKEN( "https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office-collab", XML_N_C ),
TOKEN( "svg", XML_NP_SVG ),
TOKEN( "http://www.w3.org/2000/svg", XML_N_SVG ),
TOKEN( "form", XML_NP_FORM ),
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index bfb0c8c..3f24dda 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -40,6 +40,7 @@
#include <xmloff/xmlexp.hxx>
#include <xmloff/xmluconv.hxx>
+
using namespace ::com::sun::star;
using namespace ::xmloff::token;
@@ -238,7 +239,6 @@ void XMLRedlineExport::ExportUndoChangeInfo(
OUStringBuffer sBuf;
::sax::Converter::convertDateTime(sBuf, aDateTime, nullptr);
rExport.AddAttribute(XML_NAMESPACE_DC, XML_DATE, sBuf.makeStringAndClear());
-
SvXMLElementExport aChange(rExport, XML_NAMESPACE_OFFICE,
XML_CHANGE, true, true);
ExportUndoChangedRegion(rPropSet, nParaIdx);
commit 89c22f1024e87a6b8f8685e8403b2254cc307259
Author: Rosemary Sebastian <rosemary.seb8 at gmail.com>
Date: Wed Oct 26 14:09:26 2016 +0530
Revert "WIP Save tracked changes in undo.xml"
This reverts commit 49fa48961b58bae09b7872f8ff536b73d2a88f82.
Abandoned: This is a set of experimental changes that are not useful
at present.
Change-Id: Ie9d2663c9b37ebc0cd4ddfb36c77f29ac53d74c1
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index f9f2d40..fe7e42b 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -132,7 +132,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
SwDoc *pDoc = getDoc();
if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES|
- SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::UNDO))
+ SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
{
if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 )
{
@@ -268,7 +268,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
// set redline mode if we export STYLES or CONTENT, unless redline
// mode is taken care of outside (through info XPropertySet)
bool bSaveRedline =
- bool( getExportFlags() & (SvXMLExportFlags::UNDO|SvXMLExportFlags::STYLES) );
+ bool( getExportFlags() & (SvXMLExportFlags::CONTENT|SvXMLExportFlags::STYLES) );
if( bSaveRedline )
{
// if the info property set has a ShowChanges property,
@@ -483,6 +483,7 @@ void SwXMLExport::ExportContent_()
}
}
+ GetTextParagraphExport()->exportTrackedChanges( false );
GetTextParagraphExport()->exportTextDeclarations();
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText();
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 5247201..f50e8e2 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -204,6 +204,7 @@ void SwXMLExport::ExportAutoStyles_()
// exported in ExportContent_
if( getExportFlags() & SvXMLExportFlags::CONTENT )
{
+ GetTextParagraphExport()->exportTrackedChanges( true );
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText();
More information about the Libreoffice-commits
mailing list