diff options
author | Maxime de Roucy <mderoucy@linagora.com> | 2013-04-04 18:05:24 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-25 08:55:10 +0000 |
commit | f215e634de4926def396d8442b8b15a912cb69e8 (patch) | |
tree | bcfb1be124987d29bcd620647165ba9be60e3ce3 /xmloff/source | |
parent | e42eed90b5c8151f8b5520ca2728061b1ac8e41e (diff) |
comments and code reformat
Change-Id: Ib4e45cb85c9e5e5ffa6476c939300c6795412b1a
Reviewed-on: https://gerrit.libreoffice.org/3582
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/text/XMLChangeElementImportContext.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/text/XMLChangeElementImportContext.hxx | 14 | ||||
-rw-r--r-- | xmloff/source/text/XMLChangedRegionImportContext.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/text/XMLChangedRegionImportContext.hxx | 11 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 3 |
5 files changed, 33 insertions, 10 deletions
diff --git a/xmloff/source/text/XMLChangeElementImportContext.cxx b/xmloff/source/text/XMLChangeElementImportContext.cxx index 551729bb8137..5502a46eccd9 100644 --- a/xmloff/source/text/XMLChangeElementImportContext.cxx +++ b/xmloff/source/text/XMLChangeElementImportContext.cxx @@ -71,15 +71,14 @@ SvXMLImportContext* XMLChangeElementImportContext::CreateChildContext( if (NULL == pContext) { - // no text element -> use default + // no text element + // illegal element content! TODO: discard this redline! + // for the moment -> use default pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList); - - // illegal element content! TODO: discard this redline! } } - return pContext; } diff --git a/xmloff/source/text/XMLChangeElementImportContext.hxx b/xmloff/source/text/XMLChangeElementImportContext.hxx index 80a0b78ebe0a..c9b230f39766 100644 --- a/xmloff/source/text/XMLChangeElementImportContext.hxx +++ b/xmloff/source/text/XMLChangeElementImportContext.hxx @@ -40,7 +40,21 @@ class XMLChangedRegionImportContext; */ class XMLChangeElementImportContext : public SvXMLImportContext { + /** + * accept text content (paragraphs) in element as redline content? + * + * From the "5.5.4 <text:deletion>" section of the ODF 1.2 standard : + * The <text:deletion> element may also contain content that was + * deleted while change tracking was enabled. + * + * No other section in the "5.5 Change Tracking" chapter contain + * this sentence. + * + * So if bAcceptContent is true, we are importing a <text:deletion> element + */ sal_Bool bAcceptContent; + + /// context of enclosing <text:changed-region> element XMLChangedRegionImportContext& rChangedRegion; public: diff --git a/xmloff/source/text/XMLChangedRegionImportContext.cxx b/xmloff/source/text/XMLChangedRegionImportContext.cxx index 4d857501b63c..bb4e45167098 100644 --- a/xmloff/source/text/XMLChangedRegionImportContext.cxx +++ b/xmloff/source/text/XMLChangedRegionImportContext.cxx @@ -104,6 +104,9 @@ SvXMLImportContext* XMLChangedRegionImportContext::CreateChildContext( if (XML_NAMESPACE_TEXT == nPrefix) { + // from the ODF 1.2 standard : + // The <text:changed-region> element has the following child elements: + // <text:deletion>, <text:format-change> and <text:insertion>. if ( IsXMLToken( rLocalName, XML_INSERTION ) || IsXMLToken( rLocalName, XML_DELETION ) || IsXMLToken( rLocalName, XML_FORMAT_CHANGE ) ) @@ -119,10 +122,13 @@ SvXMLImportContext* XMLChangedRegionImportContext::CreateChildContext( if (NULL == pContext) { + // illegal element content! TODO: discard the redlines + // for the moment -> use text + pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - // was it a text element? If not, use default! + // or default if text fail if (NULL == pContext) { pContext = SvXMLImportContext::CreateChildContext( diff --git a/xmloff/source/text/XMLChangedRegionImportContext.hxx b/xmloff/source/text/XMLChangedRegionImportContext.hxx index e35ceb035877..51b1870c5787 100644 --- a/xmloff/source/text/XMLChangedRegionImportContext.hxx +++ b/xmloff/source/text/XMLChangedRegionImportContext.hxx @@ -34,7 +34,10 @@ namespace com { namespace sun { namespace star { } } } } } - +/** + * Import <text:changed-region> elements contained in a + * <text:tracked-changes> element. + */ class XMLChangedRegionImportContext : public SvXMLImportContext { const OUString sEmpty; @@ -44,9 +47,11 @@ class XMLChangedRegionImportContext : public SvXMLImportContext ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor> xOldCursor; - OUString sID; /// redline-ID + /// redline-ID + OUString sID; - sal_Bool bMergeLastPara; /// merge-last-paragraph flag + /// merge-last-paragraph flag + sal_Bool bMergeLastPara; public: diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 1a4bb7a0adc6..67cb1c7dd4ad 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -561,7 +561,7 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl bool m_bBodyContentStarted : 1; // #107848# - // One more flag to remember if we are inside a deleted redline section + /// Are we inside a <text:deletion> element (deleted redline section) bool m_bInsideDeleteContext : 1; typedef ::std::pair< OUString, OUString> field_name_type_t; @@ -604,7 +604,6 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl , m_bProgress( bProgress ) , m_bOrganizerMode( bOrganizerMode ) , m_bBodyContentStarted( true ) - // #107848# Initialize inside_deleted_section flag correctly , m_bInsideDeleteContext( false ) { } |