Modified: openoffice/branches/rejuvenate01/main/xmloff/inc/txtflde.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/inc/txtflde.hxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/inc/txtflde.hxx (original)
+++ openoffice/branches/rejuvenate01/main/xmloff/inc/txtflde.hxx Fri Jan  3 
14:44:44 2014
@@ -434,109 +434,104 @@ protected:
                                                   
::com::sun::star::beans::XPropertySet > & xPropSet);
 
 
-       /// explode a field master name into field type and field name
-       sal_Bool ExplodeFieldMasterName(
-               const ::rtl::OUString& sMasterName,     /// name as returned by 
SO API
-               ::rtl::OUString& sFieldType,            /// out: field type
-               ::rtl::OUString& sVarName);                     /// out: 
variable name
-
-       /// make reference name for a foot- or endnote
-       static ::rtl::OUString MakeFootnoteRefName(sal_Int16 nSeqNo);
-
-       /// make reference name for a sequence field
-       static ::rtl::OUString MakeSequenceRefName(sal_Int16 nSeqNo, 
-                                                                               
          const ::rtl::OUString& rSeqName);
-
-private:       
-       // constants
-
-       // service names
-       const ::rtl::OUString sServicePrefix;
-       const ::rtl::OUString sFieldMasterPrefix;
-       const ::rtl::OUString sPresentationServicePrefix;
-
-       // property names
-       const ::rtl::OUString sPropertyAdjust;
-       const ::rtl::OUString sPropertyAuthor;
-       const ::rtl::OUString sPropertyChapterFormat;
-       const ::rtl::OUString sPropertyChapterNumberingLevel;
-       const ::rtl::OUString sPropertyCharStyleNames;
-       const ::rtl::OUString sPropertyCondition;
-       const ::rtl::OUString sPropertyContent;
-       const ::rtl::OUString sPropertyDataBaseName;
-       const ::rtl::OUString sPropertyDataBaseURL;
-       const ::rtl::OUString sPropertyDataColumnName;
-       const ::rtl::OUString sPropertyDataCommandType;
-       const ::rtl::OUString sPropertyDataTableName;
-       const ::rtl::OUString sPropertyDate;
-       const ::rtl::OUString sPropertyDateTime;
-       const ::rtl::OUString sPropertyDateTimeValue;
-       const ::rtl::OUString sPropertyDDECommandElement;
-       const ::rtl::OUString sPropertyDDECommandFile;
-       const ::rtl::OUString sPropertyDDECommandType;
-       const ::rtl::OUString sPropertyDependentTextFields;
-       const ::rtl::OUString sPropertyFalseContent;
-       const ::rtl::OUString sPropertyFields;
-       const ::rtl::OUString sPropertyFieldSubType;
-       const ::rtl::OUString sPropertyFileFormat;
-       const ::rtl::OUString sPropertyFullName;
-       const ::rtl::OUString sPropertyHint;
-       const ::rtl::OUString sPropertyInstanceName;
-       const ::rtl::OUString sPropertyIsAutomaticUpdate;
-       const ::rtl::OUString sPropertyIsConditionTrue;
-       const ::rtl::OUString sPropertyIsDataBaseFormat;
-       const ::rtl::OUString sPropertyIsDate;
-       const ::rtl::OUString sPropertyIsExpression;
-       const ::rtl::OUString sPropertyIsFixed;
-       const ::rtl::OUString sPropertyIsFixedLanguage;
-       const ::rtl::OUString sPropertyIsHidden;
-       const ::rtl::OUString sPropertyIsInput;
-       const ::rtl::OUString sPropertyIsShowFormula;
-       const ::rtl::OUString sPropertyIsVisible;
-       const ::rtl::OUString sPropertyItems;
-       const ::rtl::OUString sPropertyLevel;
-       const ::rtl::OUString sPropertyMacro;
-       const ::rtl::OUString sPropertyMeasureKind;
-       const ::rtl::OUString sPropertyName;
-       const ::rtl::OUString sPropertyNumberFormat;
-       const ::rtl::OUString sPropertyNumberingSeparator;
-       const ::rtl::OUString sPropertyNumberingType;
-       const ::rtl::OUString sPropertyOffset;
-       const ::rtl::OUString sPropertyOn;
-       const ::rtl::OUString sPropertyPlaceholder;
-       const ::rtl::OUString sPropertyPlaceholderType;
-       const ::rtl::OUString sPropertyReferenceFieldPart;
-       const ::rtl::OUString sPropertyReferenceFieldSource;
-       const ::rtl::OUString sPropertyReferenceFieldType;
-       const ::rtl::OUString sPropertyRevision;
-       const ::rtl::OUString sPropertyScriptType;
-       const ::rtl::OUString sPropertySelectedItem;
-       const ::rtl::OUString sPropertySequenceNumber;
-       const ::rtl::OUString sPropertySequenceValue;
-       const ::rtl::OUString sPropertySetNumber;
-       const ::rtl::OUString sPropertySourceName;
-       const ::rtl::OUString sPropertySubType;
-       const ::rtl::OUString sPropertyTargetFrame;
-       const ::rtl::OUString sPropertyTrueContent;
-       const ::rtl::OUString sPropertyURL;
-       const ::rtl::OUString sPropertyURLContent;
-       const ::rtl::OUString sPropertyUserText;
-       const ::rtl::OUString sPropertyValue;
-       const ::rtl::OUString sPropertyVariableName;
-       const ::rtl::OUString sPropertyVariableSubType;
+    /// explode a field master name into field type and field name
+    sal_Bool ExplodeFieldMasterName(
+        const ::rtl::OUString& sMasterName,    /// name as returned by SO API
+        ::rtl::OUString& sFieldType,           /// out: field type
+        ::rtl::OUString& sVarName);                    /// out: variable name
+
+    /// make reference name for a foot- or endnote
+    static ::rtl::OUString MakeFootnoteRefName(sal_Int16 nSeqNo);
+
+    /// make reference name for a sequence field
+    static ::rtl::OUString MakeSequenceRefName(
+        sal_Int16 nSeqNo,
+        const ::rtl::OUString& rSeqName );
+
+private:
+    // service names
+    const ::rtl::OUString sServicePrefix;
+    const ::rtl::OUString sFieldMasterPrefix;
+    const ::rtl::OUString sPresentationServicePrefix;
+
+    // property names
+    const ::rtl::OUString sPropertyAdjust;
+    const ::rtl::OUString sPropertyAuthor;
+    const ::rtl::OUString sPropertyChapterFormat;
+    const ::rtl::OUString sPropertyChapterNumberingLevel;
+    const ::rtl::OUString sPropertyCharStyleNames;
+    const ::rtl::OUString sPropertyCondition;
+    const ::rtl::OUString sPropertyContent;
+    const ::rtl::OUString sPropertyDataBaseName;
+    const ::rtl::OUString sPropertyDataBaseURL;
+    const ::rtl::OUString sPropertyDataColumnName;
+    const ::rtl::OUString sPropertyDataCommandType;
+    const ::rtl::OUString sPropertyDataTableName;
+    const ::rtl::OUString sPropertyDate;
+    const ::rtl::OUString sPropertyDateTime;
+    const ::rtl::OUString sPropertyDateTimeValue;
+    const ::rtl::OUString sPropertyDDECommandElement;
+    const ::rtl::OUString sPropertyDDECommandFile;
+    const ::rtl::OUString sPropertyDDECommandType;
+    const ::rtl::OUString sPropertyDependentTextFields;
+    const ::rtl::OUString sPropertyFalseContent;
+    const ::rtl::OUString sPropertyFields;
+    const ::rtl::OUString sPropertyFieldSubType;
+    const ::rtl::OUString sPropertyFileFormat;
+    const ::rtl::OUString sPropertyFullName;
+    const ::rtl::OUString sPropertyHint;
+    const ::rtl::OUString sPropertyInitials;
+    const ::rtl::OUString sPropertyInstanceName;
+    const ::rtl::OUString sPropertyIsAutomaticUpdate;
+    const ::rtl::OUString sPropertyIsConditionTrue;
+    const ::rtl::OUString sPropertyIsDataBaseFormat;
+    const ::rtl::OUString sPropertyIsDate;
+    const ::rtl::OUString sPropertyIsExpression;
+    const ::rtl::OUString sPropertyIsFixed;
+    const ::rtl::OUString sPropertyIsFixedLanguage;
+    const ::rtl::OUString sPropertyIsHidden;
+    const ::rtl::OUString sPropertyIsInput;
+    const ::rtl::OUString sPropertyIsShowFormula;
+    const ::rtl::OUString sPropertyIsVisible;
+    const ::rtl::OUString sPropertyItems;
+    const ::rtl::OUString sPropertyLevel;
+    const ::rtl::OUString sPropertyMacro;
+    const ::rtl::OUString sPropertyMeasureKind;
+    const ::rtl::OUString sPropertyName;
+    const ::rtl::OUString sPropertyNumberFormat;
+    const ::rtl::OUString sPropertyNumberingSeparator;
+    const ::rtl::OUString sPropertyNumberingType;
+    const ::rtl::OUString sPropertyOffset;
+    const ::rtl::OUString sPropertyOn;
+    const ::rtl::OUString sPropertyPlaceholder;
+    const ::rtl::OUString sPropertyPlaceholderType;
+    const ::rtl::OUString sPropertyReferenceFieldPart;
+    const ::rtl::OUString sPropertyReferenceFieldSource;
+    const ::rtl::OUString sPropertyReferenceFieldType;
+    const ::rtl::OUString sPropertyRevision;
+    const ::rtl::OUString sPropertyScriptType;
+    const ::rtl::OUString sPropertySelectedItem;
+    const ::rtl::OUString sPropertySequenceNumber;
+    const ::rtl::OUString sPropertySequenceValue;
+    const ::rtl::OUString sPropertySetNumber;
+    const ::rtl::OUString sPropertySourceName;
+    const ::rtl::OUString sPropertySubType;
+    const ::rtl::OUString sPropertyTargetFrame;
+    const ::rtl::OUString sPropertyTrueContent;
+    const ::rtl::OUString sPropertyURL;
+    const ::rtl::OUString sPropertyURLContent;
+    const ::rtl::OUString sPropertyUserText;
+    const ::rtl::OUString sPropertyValue;
+    const ::rtl::OUString sPropertyVariableName;
+    const ::rtl::OUString sPropertyVariableSubType;
     const ::rtl::OUString sPropertyHelp;
     const ::rtl::OUString sPropertyTooltip;
     const ::rtl::OUString sPropertyTextRange;
 
-       const ::rtl::OUString sEmpty;
+    const ::rtl::OUString sEmpty;
 
-       XMLPropertyState* pCombinedCharactersPropertyState;
+    XMLPropertyState* pCombinedCharactersPropertyState;
 
 };
 
-
-
-
-
-
 #endif

Modified: openoffice/branches/rejuvenate01/main/xmloff/inc/txtfldi.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/inc/txtfldi.hxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/inc/txtfldi.hxx (original)
+++ openoffice/branches/rejuvenate01/main/xmloff/inc/txtfldi.hxx Fri Jan  3 
14:44:44 2014
@@ -1342,30 +1342,39 @@ protected:
 };
 
 
-/** Import an annotation field (<text:annotation>) */
+/** Import an annotation field (<office:annotation>) */
 class XMLAnnotationImportContext : public XMLTextFieldImportContext
 {
-       const ::rtl::OUString sPropertyAuthor;
-       const ::rtl::OUString sPropertyContent;
-       const ::rtl::OUString sPropertyDate;
-       const ::rtl::OUString sPropertyTextRange;
-
-       ::rtl::OUStringBuffer aAuthorBuffer;
-       ::rtl::OUStringBuffer aTextBuffer;
-       ::rtl::OUStringBuffer aDateBuffer;
+    const ::rtl::OUString sPropertyName;
+    const ::rtl::OUString sPropertyAuthor;
+    const ::rtl::OUString sPropertyInitials;
+    const ::rtl::OUString sPropertyContent;
+    const ::rtl::OUString sPropertyDate;
+    const ::rtl::OUString sPropertyTextRange;
+
+    ::rtl::OUString aName;
+
+    ::rtl::OUStringBuffer aAuthorBuffer;
+    ::rtl::OUStringBuffer aInitialsBuffer;
+    ::rtl::OUStringBuffer aTextBuffer;
+    ::rtl::OUStringBuffer aDateBuffer;
+
+    com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > 
mxField;
+    com::sun::star::uno::Reference < com::sun::star::text::XTextCursor >  
mxCursor;
+    com::sun::star::uno::Reference < com::sun::star::text::XTextCursor >  
mxOldCursor;
 
-       com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > 
mxField;
-       com::sun::star::uno::Reference < com::sun::star::text::XTextCursor >  
mxCursor;
-       com::sun::star::uno::Reference < com::sun::star::text::XTextCursor >  
mxOldCursor;
+    const sal_uInt16 m_nToken;
 
 public:
 
-       TYPEINFO();
+    TYPEINFO();
 
-       XMLAnnotationImportContext(SvXMLImport& rImport,
-                                                          XMLTextImportHelper& 
rHlp,
-                                                          sal_uInt16 nPrfx,
-                                                          const 
::rtl::OUString& sLocalName);
+    XMLAnnotationImportContext(
+        SvXMLImport& rImport,
+        XMLTextImportHelper& rHlp,
+        sal_uInt16 nToken,
+        sal_uInt16 nPrfx,
+        const ::rtl::OUString& sLocalName);
 
 protected:
 
@@ -1375,8 +1384,7 @@ protected:
 
        /// set properties
        virtual void PrepareField(
-               const ::com::sun::star::uno::Reference<
-               ::com::sun::star::beans::XPropertySet> & xPropertySet);
+               const ::com::sun::star::uno::Reference< 
::com::sun::star::beans::XPropertySet > & xPropertySet);
 
        virtual SvXMLImportContext *CreateChildContext(
                sal_uInt16 nPrefix,

Modified: openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/odffields.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/odffields.hxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/odffields.hxx 
(original)
+++ openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/odffields.hxx Fri 
Jan  3 14:44:44 2014
@@ -46,4 +46,6 @@
 
 #define ODF_PAGEREF "vnd.oasis.opendocument.field.PAGEREF"
 
+#define ODF_COMMENTRANGE "vnd.oasis.opendocument.field.COMMENTRANGE"
+
 #endif /*  _ODFFIELDS_HXX */

Modified: openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/txtimp.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/txtimp.hxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/txtimp.hxx 
(original)
+++ openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/txtimp.hxx Fri Jan  
3 14:44:44 2014
@@ -224,7 +224,9 @@ enum XMLTextPElemTokens
        XML_TOK_TEXT_SHEET_NAME,
        XML_TOK_TEXT_BIBLIOGRAPHY_MARK,
        XML_TOK_TEXT_ANNOTATION,
-       XML_TOK_TEXT_SCRIPT,
+    XML_TOK_TEXT_ANNOTATION_END,
+    XML_TOK_TEXT_NAME,
+    XML_TOK_TEXT_SCRIPT,
     XML_TOK_TEXT_TABLE_FORMULA,
     XML_TOK_TEXT_DROPDOWN,
 

Modified: openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/xmlnmspe.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/xmlnmspe.hxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/xmlnmspe.hxx 
(original)
+++ openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/xmlnmspe.hxx Fri 
Jan  3 14:44:44 2014
@@ -85,8 +85,9 @@ XML_NAMESPACE_EXT( OFFICE,      37U )
 XML_NAMESPACE_EXT( TABLE,       38U )
 XML_NAMESPACE_EXT( CHART,       39U )
 XML_NAMESPACE_EXT( DRAW,               40U )
+XML_NAMESPACE_EXT( TEXT,        41U )
 
-#define _XML_OLD_NAMESPACE_BASE 41U
+#define _XML_OLD_NAMESPACE_BASE 42U
 
 // namespaces used in the technical preview (SO 5.2)
 XML_OLD_NAMESPACE( FO,         0U )

Modified: openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/xmltoken.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/xmltoken.hxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/xmltoken.hxx 
(original)
+++ openoffice/branches/rejuvenate01/main/xmloff/inc/xmloff/xmltoken.hxx Fri 
Jan  3 14:44:44 2014
@@ -147,6 +147,9 @@ namespace xmloff { namespace token {
         XML_NP_DRAW_EXT,
         XML_N_DRAW_EXT,
 
+        XML_NP_TEXT_EXT,
+        XML_N_TEXT_EXT,
+
         // units
         XML_UNIT_MM,
         XML_UNIT_M,
@@ -227,6 +230,7 @@ namespace xmloff { namespace token {
         XML_ANIMATION_STOP_INSIDE,
         XML_ANIMATIONS,
         XML_ANNOTATION,
+        XML_ANNOTATION_END,
         XML_ANNOTATIONS,
         XML_ANNOTE,
         XML_APPEAR,

Modified: openoffice/branches/rejuvenate01/main/xmloff/source/core/xmlimp.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/source/core/xmlimp.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/source/core/xmlimp.cxx 
(original)
+++ openoffice/branches/rejuvenate01/main/xmloff/source/core/xmlimp.cxx Fri Jan 
 3 14:44:44 2014
@@ -92,6 +92,7 @@ sal_Char __READONLY_DATA sXML_np__oooc[]
 sal_Char __READONLY_DATA sXML_np__of[] = "_of";
 sal_Char __READONLY_DATA sXML_np__style[] = "_style";
 sal_Char __READONLY_DATA sXML_np__text[] = "_text";
+sal_Char __READONLY_DATA sXML_np__text_ext[] = "_text_ooo";
 sal_Char __READONLY_DATA sXML_np__table[] = "_table";
 sal_Char __READONLY_DATA sXML_np__table_ext[] = "_table_ooo";
 sal_Char __READONLY_DATA sXML_np__draw[] = "_draw";
@@ -308,8 +309,7 @@ void SvXMLImport::_InitCtor()
        if( mnImportFlags != 0 )
        {
                // implicit "xml" namespace prefix
-               mpNamespaceMap->Add( GetXMLToken(XML_XML), 
GetXMLToken(XML_N_XML),
-                            XML_NAMESPACE_XML );
+        mpNamespaceMap->Add( GetXMLToken(XML_XML), GetXMLToken(XML_N_XML), 
XML_NAMESPACE_XML );
                mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( 
sXML_np__office ) ),
                                                        
GetXMLToken(XML_N_OFFICE),
                                                        XML_NAMESPACE_OFFICE );
@@ -323,6 +323,9 @@ void SvXMLImport::_InitCtor()
                mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( 
sXML_np__text) ),
                                                        GetXMLToken(XML_N_TEXT),
                                                        XML_NAMESPACE_TEXT );
+        mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( 
sXML_np__text_ext ) ),
+            GetXMLToken(XML_N_TEXT_EXT),
+            XML_NAMESPACE_TEXT_EXT );
                mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( 
sXML_np__table ) ),
                                                        
GetXMLToken(XML_N_TABLE),
                                                        XML_NAMESPACE_TABLE );

Modified: openoffice/branches/rejuvenate01/main/xmloff/source/core/xmltoken.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/source/core/xmltoken.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/source/core/xmltoken.cxx 
(original)
+++ openoffice/branches/rejuvenate01/main/xmloff/source/core/xmltoken.cxx Fri 
Jan  3 14:44:44 2014
@@ -155,6 +155,9 @@ namespace xmloff { namespace token {
         TOKEN( "drawooo", XML_NP_DRAW_EXT ),
         TOKEN( "http://openoffice.org/2010/draw";, XML_N_DRAW_EXT ),
 
+        TOKEN( "textooo", XML_NP_TEXT_EXT ),
+        TOKEN( "http://openoffice.org/2013/office";, XML_N_TEXT_EXT ),
+
         // units
         TOKEN( "mm",                              XML_UNIT_MM ),
         TOKEN( "m",                               XML_UNIT_M ),
@@ -235,6 +238,7 @@ namespace xmloff { namespace token {
         TOKEN( "animation-stop-inside",           XML_ANIMATION_STOP_INSIDE ),
         TOKEN( "animations",                      XML_ANIMATIONS ),
         TOKEN( "annotation",                      XML_ANNOTATION ),
+        TOKEN( "annotation-end",                  XML_ANNOTATION_END ),
         TOKEN( "annotations",                     XML_ANNOTATIONS ),
         TOKEN( "annote",                          XML_ANNOTE ),
         TOKEN( "appear",                          XML_APPEAR ),

Modified: openoffice/branches/rejuvenate01/main/xmloff/source/text/txtflde.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/source/text/txtflde.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/source/text/txtflde.cxx 
(original)
+++ openoffice/branches/rejuvenate01/main/xmloff/source/text/txtflde.cxx Fri 
Jan  3 14:44:44 2014
@@ -311,6 +311,7 @@ XMLTextFieldExport::XMLTextFieldExport( 
        sPropertyFileFormat(RTL_CONSTASCII_USTRINGPARAM("FileFormat")),
        sPropertyFullName(RTL_CONSTASCII_USTRINGPARAM("FullName")),
        sPropertyHint(RTL_CONSTASCII_USTRINGPARAM("Hint")),
+    sPropertyInitials(RTL_CONSTASCII_USTRINGPARAM("Initials")),
        sPropertyInstanceName(RTL_CONSTASCII_USTRINGPARAM("InstanceName")),
        
sPropertyIsAutomaticUpdate(RTL_CONSTASCII_USTRINGPARAM("IsAutomaticUpdate")),
        
sPropertyIsConditionTrue(RTL_CONSTASCII_USTRINGPARAM("IsConditionTrue")),
@@ -1730,13 +1731,18 @@ void XMLTextFieldExport::ExportFieldHelp
                DBG_ASSERT(sPresentation.equals(sEmpty),
                                   "Unexpected presentation for annotation 
field");
 
-               // annotation element + content
-               SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_OFFICE,
-                                                                
XML_ANNOTATION, sal_False, sal_True);
+        // annotation element + content
+        OUString aAnnotationName;
+        rPropSet->getPropertyValue(sPropertyName) >>= aAnnotationName;
+        if ( aAnnotationName.getLength() > 0 )
+        {
+            GetExport().AddAttribute( XML_NAMESPACE_OFFICE, XML_NAME, 
aAnnotationName );
+        }
+        SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_OFFICE, 
XML_ANNOTATION, sal_False, sal_True );
 
                // author
                OUString aAuthor( GetStringProperty(sPropertyAuthor, rPropSet) 
);
-               if( aAuthor.getLength() )
+               if ( aAuthor.getLength() > 0 )
                {
                        SvXMLElementExport aCreatorElem( GetExport(), 
XML_NAMESPACE_DC,
                                                                                
          XML_CREATOR, sal_True,
@@ -1757,6 +1763,22 @@ void XMLTextFieldExport::ExportFieldHelp
                        GetExport().Characters(aBuffer.makeStringAndClear());
                }
 
+        // initials
+        if ( GetExport().getDefaultVersion() > SvtSaveOptions::ODFVER_012 )
+        {
+            OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) 
);
+            if ( aInitials.getLength() > 0 )
+            {
+                SvXMLElementExport aCreatorElem(
+                    GetExport(),
+                    XML_NAMESPACE_TEXT_EXT,
+                    XML_SENDER_INITIALS,
+                    sal_True,
+                    sal_False );
+                GetExport().Characters(aInitials);
+            }
+        }
+
                com::sun::star::uno::Reference < com::sun::star::text::XText > 
xText;
                try
                {

Modified: openoffice/branches/rejuvenate01/main/xmloff/source/text/txtfldi.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/source/text/txtfldi.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/source/text/txtfldi.cxx 
(original)
+++ openoffice/branches/rejuvenate01/main/xmloff/source/text/txtfldi.cxx Fri 
Jan  3 14:44:44 2014
@@ -153,6 +153,7 @@ const sal_Char sAPI_is_fixed[]                      = "IsFi
 const sal_Char sAPI_content[]                  = "Content";
 const sal_Char sAPI_value[]                            = "Value";
 const sal_Char sAPI_author[]                   = "Author";
+const sal_Char sAPI_initials[]          = "Initials";
 const sal_Char sAPI_full_name[]                        = "FullName";
 const sal_Char sAPI_place_holder_type[] = "PlaceHolderType";
 const sal_Char sAPI_place_holder[]             = "PlaceHolder";
@@ -560,10 +561,11 @@ XMLTextFieldImportContext::CreateTextFie
                                                                                
                                          nPrefix, rName );
                        break;
 
-               case XML_TOK_TEXT_ANNOTATION:
-                       pContext = new XMLAnnotationImportContext( rImport, 
rHlp,
-                                                                               
                           nPrefix, rName);
-                       break;
+        case XML_TOK_TEXT_ANNOTATION:
+        case XML_TOK_TEXT_ANNOTATION_END:
+            pContext =
+                new XMLAnnotationImportContext( rImport, rHlp, nToken, 
nPrefix, rName);
+            break;
 
                case XML_TOK_TEXT_SCRIPT:
                        pContext = new XMLScriptImportContext( rImport, rHlp,
@@ -3629,19 +3631,21 @@ const sal_Char* XMLBibliographyFieldImpo
 TYPEINIT1(XMLAnnotationImportContext, XMLTextFieldImportContext);
 
 XMLAnnotationImportContext::XMLAnnotationImportContext(
-       SvXMLImport& rImport,
-       XMLTextImportHelper& rHlp,
-       sal_uInt16 nPrfx,
-       const OUString& sLocalName) :
-               XMLTextFieldImportContext(rImport, rHlp, sAPI_annotation, 
-                                                                 nPrfx, 
sLocalName), 
-               sPropertyAuthor(RTL_CONSTASCII_USTRINGPARAM(sAPI_author)),
-               sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content)),
-               // why is there no UNO_NAME_DATE_TIME, but only 
UNO_NAME_DATE_TIME_VALUE?
-               
sPropertyDate(RTL_CONSTASCII_USTRINGPARAM(sAPI_date_time_value)),
-               sPropertyTextRange(RTL_CONSTASCII_USTRINGPARAM(sAPI_TextRange))
+    SvXMLImport& rImport,
+    XMLTextImportHelper& rHlp,
+    sal_uInt16 nToken,
+    sal_uInt16 nPrfx,
+    const OUString& sLocalName)
+    : XMLTextFieldImportContext(rImport, rHlp, sAPI_annotation, nPrfx, 
sLocalName)
+    , sPropertyName(RTL_CONSTASCII_USTRINGPARAM(sAPI_name))
+    , sPropertyAuthor(RTL_CONSTASCII_USTRINGPARAM(sAPI_author))
+    , sPropertyInitials(RTL_CONSTASCII_USTRINGPARAM(sAPI_initials))
+    , sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content))
+    , sPropertyDate(RTL_CONSTASCII_USTRINGPARAM(sAPI_date_time_value))
+    , sPropertyTextRange(RTL_CONSTASCII_USTRINGPARAM(sAPI_TextRange))
+    , m_nToken( nToken )
 {
-       bValid = sal_True;
+    bValid = sal_True;
 
     // remember old list item and block (#91964#) and reset them
     // for the text frame
@@ -3649,139 +3653,200 @@ XMLAnnotationImportContext::XMLAnnotatio
     GetImport().GetTextImport()->PushListContext();
 }
 
-void XMLAnnotationImportContext::ProcessAttribute( 
-       sal_uInt16,
-       const OUString& )
-{
-       // ignore
+void XMLAnnotationImportContext::ProcessAttribute(
+    sal_uInt16 nToken,
+    const OUString& rValue )
+ {
+    if ( nToken == XML_TOK_TEXT_NAME )
+    {
+        aName = rValue;
+    }
 }
 
 SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext(
-       sal_uInt16 nPrefix,
-       const OUString& rLocalName,
-       const Reference<XAttributeList >& xAttrList )
+    sal_uInt16 nPrefix,
+    const OUString& rLocalName,
+    const Reference<XAttributeList >& xAttrList )
 {
-       SvXMLImportContext *pContext = 0;
-       if( XML_NAMESPACE_DC == nPrefix )
-       {
-               if( IsXMLToken( rLocalName, XML_CREATOR ) )
-                       pContext = new 
XMLStringBufferImportContext(GetImport(), nPrefix, 
-                                                                               
        rLocalName, aAuthorBuffer);
-               else if( IsXMLToken( rLocalName, XML_DATE ) )
-                       pContext = new 
XMLStringBufferImportContext(GetImport(), nPrefix, 
-                                                                               
        rLocalName, aDateBuffer);
-       }
+    SvXMLImportContext *pContext = 0;
+    if( XML_NAMESPACE_DC == nPrefix )
+    {
+        if( IsXMLToken( rLocalName, XML_CREATOR ) )
+        {
+            pContext =
+                new XMLStringBufferImportContext( GetImport(), nPrefix, 
rLocalName, aAuthorBuffer);
+        }
+        else if( IsXMLToken( rLocalName, XML_DATE ) )
+        {
+            pContext =
+                new XMLStringBufferImportContext( GetImport(), nPrefix, 
rLocalName, aDateBuffer);
+        }
+    }
+    else if ( XML_NAMESPACE_TEXT == nPrefix
+              || XML_NAMESPACE_TEXT_EXT == nPrefix )
+    {
+        if( IsXMLToken( rLocalName, XML_SENDER_INITIALS ) )
+        {
+            pContext =
+                new XMLStringBufferImportContext( GetImport(), nPrefix, 
rLocalName, aInitialsBuffer);
+        }
+    }
 
-       if( !pContext )
-       {
-               try
-               {
-                       if ( !mxField.is() )
-                               CreateField( mxField, sServicePrefix + 
GetServiceName() );
-                       Any aAny = mxField->getPropertyValue( 
sPropertyTextRange );
-                       Reference< XText > xText;
-                       aAny >>= xText;
-                       if( xText.is() )
-                       {
-                               UniReference < XMLTextImportHelper > xTxtImport 
= GetImport().GetTextImport();
-                               if( !mxCursor.is() )
-                               {
-                                       mxOldCursor = xTxtImport->GetCursor();
-                                       mxCursor = xText->createTextCursor();
-                               }
+    if( !pContext )
+    {
+        try
+        {
+            if ( !mxField.is() )
+                CreateField( mxField, sServicePrefix + GetServiceName() );
+            Any aAny = mxField->getPropertyValue( sPropertyTextRange );
+            Reference< XText > xText;
+            aAny >>= xText;
+            if( xText.is() )
+            {
+                UniReference < XMLTextImportHelper > xTxtImport = 
GetImport().GetTextImport();
+                if( !mxCursor.is() )
+                {
+                    mxOldCursor = xTxtImport->GetCursor();
+                    mxCursor = xText->createTextCursor();
+                }
 
-                               if( mxCursor.is() )
-                               {
-                                       xTxtImport->SetCursor( mxCursor );
-                                       pContext = 
xTxtImport->CreateTextChildContext( GetImport(), nPrefix, rLocalName, xAttrList 
);
-                               }
-                       }
-               }
-               catch ( Exception& ) 
-               {}
+                if( mxCursor.is() )
+                {
+                    xTxtImport->SetCursor( mxCursor );
+                    pContext = xTxtImport->CreateTextChildContext( 
GetImport(), nPrefix, rLocalName, xAttrList );
+                }
+            }
+        }
+        catch ( Exception& ) 
+        {}
 
-               if( !pContext )
-                       pContext = new 
XMLStringBufferImportContext(GetImport(), nPrefix,  rLocalName, aTextBuffer);
-       }
+        if( !pContext )
+            pContext = new XMLStringBufferImportContext(GetImport(), nPrefix,  
rLocalName, aTextBuffer);
+    }
 
-       return pContext;
+    return pContext;
 }
 
 void XMLAnnotationImportContext::EndElement()
 {
-       DBG_ASSERT(GetServiceName().getLength()>0, "no service name for 
element!");
-       if( mxCursor.is() )
-       {
-               // delete addition newline
-               const OUString aEmpty;
-               mxCursor->gotoEnd( sal_False );
-               mxCursor->goLeft( 1, sal_True );
-               mxCursor->setString( aEmpty );
+    DBG_ASSERT(GetServiceName().getLength()>0, "no service name for element!");
+    if( mxCursor.is() )
+    {
+        // delete addition newline
+        const OUString aEmpty;
+        mxCursor->gotoEnd( sal_False );
+        mxCursor->goLeft( 1, sal_True );
+        mxCursor->setString( aEmpty );
 
-               // reset cursor
-               GetImport().GetTextImport()->ResetCursor();
-       }
+        // reset cursor
+        GetImport().GetTextImport()->ResetCursor();
+    }
 
-       if( mxOldCursor.is() )
-               GetImport().GetTextImport()->SetCursor( mxOldCursor );
+    if( mxOldCursor.is() )
+        GetImport().GetTextImport()->SetCursor( mxOldCursor );
 
     // reinstall old list item #91964#
     GetImport().GetTextImport()->PopListContext();
 
-       if ( bValid )
-       {
-               if ( mxField.is() || CreateField( mxField, sServicePrefix + 
GetServiceName() ) )
-               {
-                       // set field properties
-                       PrepareField( mxField );
+    if ( bValid )
+    {
+        if ( m_nToken == XML_TOK_TEXT_ANNOTATION_END )
+        {
+            // Search for a previous annotation with the same name.
+            uno::Reference< text::XTextContent > xPrevField;
+            {
+                Reference<XTextFieldsSupplier> 
xTextFieldsSupplier(GetImport().GetModel(), UNO_QUERY);
+                uno::Reference<container::XEnumerationAccess> 
xFieldsAccess(xTextFieldsSupplier->getTextFields());
+                uno::Reference<container::XEnumeration> 
xFields(xFieldsAccess->createEnumeration());
+                while (xFields->hasMoreElements())
+                {
+                    uno::Reference<beans::XPropertySet> 
xCurrField(xFields->nextElement(), uno::UNO_QUERY);
+                    OUString aFieldName;
+                    xCurrField->getPropertyValue(sPropertyName) >>= aFieldName;
+                    if ( aFieldName == aName )
+                    {
+                        xPrevField.set( xCurrField, uno::UNO_QUERY );
+                        break;
+                    }
+                }
+            }
+            if ( xPrevField.is() )
+            {
+                // So we are ending a previous annotation,
+                // let's create a text range covering the start and the 
current position.
+                uno::Reference< text::XText > xText = 
GetImportHelper().GetText();
+                uno::Reference< text::XTextCursor > xCursor =
+                    xText->createTextCursorByRange( xPrevField->getAnchor() );
+                xCursor->gotoRange( GetImportHelper().GetCursorAsRange(), true 
);
+                uno::Reference< text::XTextRange > xTextRange( xCursor, 
uno::UNO_QUERY );
 
-                       // attach field to document
-                       Reference < XTextContent > xTextContent( mxField, 
UNO_QUERY );
+                xText->insertTextContent( xTextRange, xPrevField, 
!xCursor->isCollapsed() );
+            }
+        }
+        else
+        {
+            if ( mxField.is() || CreateField( mxField, sServicePrefix + 
GetServiceName() ) )
+            {
+                // set field properties
+                PrepareField( mxField );
 
-                       // workaround for #80606#
-                       try
-                       {
-                               GetImportHelper().InsertTextContent( 
xTextContent );
-                       }
-                       catch (lang::IllegalArgumentException)
-                       {
-                               // ignore
-                       }
-               }
-       }
-       else
-               GetImportHelper().InsertString(GetContent());
+                // attach field to document
+                Reference < XTextContent > xTextContent( mxField, UNO_QUERY );
+
+                // workaround for #80606#
+                try
+                {
+                    GetImportHelper().InsertTextContent( xTextContent );
+                }
+                catch (lang::IllegalArgumentException)
+                {
+                    // ignore
+                }
+            }
+        }
+    }
+    else
+        GetImportHelper().InsertString(GetContent());
 }
 
-void XMLAnnotationImportContext::PrepareField( 
-       const Reference<XPropertySet> & xPropertySet)
+void XMLAnnotationImportContext::PrepareField(
+    const Reference<XPropertySet> & xPropertySet )
 {
-       // import (possibly empty) author
-       OUString sAuthor( aAuthorBuffer.makeStringAndClear() );
-       xPropertySet->setPropertyValue(sPropertyAuthor, makeAny(sAuthor));
-
-       DateTime aDateTime;
-       if (SvXMLUnitConverter::convertDateTime(aDateTime, 
-                                                                               
        aDateBuffer.makeStringAndClear()))
-       {
-               /*
-               Date aDate;
-               aDate.Year = aDateTime.Year;
-               aDate.Month = aDateTime.Month;
-               aDate.Day = aDateTime.Day;
-               xPropertySet->setPropertyValue(sPropertyDate, makeAny(aDate));
-               */
-               xPropertySet->setPropertyValue(sPropertyDate, 
makeAny(aDateTime));
-       }
-
-       OUString sBuffer = aTextBuffer.makeStringAndClear();
-       if ( sBuffer.getLength() )
-       {
-               // delete last paragraph mark (if necessary)
-               if (sal_Char(0x0a) == sBuffer.getStr()[sBuffer.getLength()-1])
-                       sBuffer = sBuffer.copy(0, sBuffer.getLength()-1);
-               xPropertySet->setPropertyValue(sPropertyContent, 
makeAny(sBuffer));
-       }
+    // import (possibly empty) author
+    OUString sAuthor( aAuthorBuffer.makeStringAndClear() );
+    xPropertySet->setPropertyValue(sPropertyAuthor, makeAny(sAuthor));
+
+    // import (possibly empty) initials
+    OUString sInitials( aInitialsBuffer.makeStringAndClear() );
+    xPropertySet->setPropertyValue(sPropertyInitials, makeAny(sInitials));
+
+    DateTime aDateTime;
+    if (SvXMLUnitConverter::convertDateTime(aDateTime, 
+        aDateBuffer.makeStringAndClear()))
+    {
+        /*
+        Date aDate;
+        aDate.Year = aDateTime.Year;
+        aDate.Month = aDateTime.Month;
+        aDate.Day = aDateTime.Day;
+        xPropertySet->setPropertyValue(sPropertyDate, makeAny(aDate));
+        */
+        xPropertySet->setPropertyValue(sPropertyDate, makeAny(aDateTime));
+    }
+
+    OUString sBuffer = aTextBuffer.makeStringAndClear();
+    if ( sBuffer.getLength() > 0 )
+    {
+        // delete last paragraph mark (if necessary)
+        if (sal_Char(0x0a) == sBuffer.getStr()[sBuffer.getLength()-1])
+            sBuffer = sBuffer.copy(0, sBuffer.getLength()-1);
+        xPropertySet->setPropertyValue(sPropertyContent, makeAny(sBuffer));
+    }
+
+    if ( aName.getLength() > 0 )
+    {
+        xPropertySet->setPropertyValue(sPropertyName, makeAny(aName));
+    }
 }
 
 

Modified: openoffice/branches/rejuvenate01/main/xmloff/source/text/txtimp.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/source/text/txtimp.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/source/text/txtimp.cxx 
(original)
+++ openoffice/branches/rejuvenate01/main/xmloff/source/text/txtimp.cxx Fri Jan 
 3 14:44:44 2014
@@ -87,13 +87,9 @@
 #include "XMLCalculationSettingsContext.hxx"
 #include <xmloff/formsimp.hxx>
 #include "XMLNumberStylesImport.hxx"
-// --> OD 2006-10-12 #i69629#
 #include <com/sun/star/beans/XPropertyState.hpp>
-// <--
 
-// --> OD 2008-04-25 #refactorlists#
 #include <txtlists.hxx>
-// <--
 #include <xmloff/odffields.hxx>
 #include <comphelper/stlunosequence.hxx>
 
@@ -202,16 +198,13 @@ static __FAR_DATA SvXMLTokenMapEntry aTe
        { XML_NAMESPACE_TEXT, XML_SENDER_TITLE, XML_TOK_TEXT_SENDER_TITLE },
        { XML_NAMESPACE_TEXT, XML_SENDER_POSITION, XML_TOK_TEXT_SENDER_POSITION 
},
        { XML_NAMESPACE_TEXT, XML_SENDER_EMAIL, XML_TOK_TEXT_SENDER_EMAIL },
-       { XML_NAMESPACE_TEXT, XML_SENDER_PHONE_PRIVATE,
-         XML_TOK_TEXT_SENDER_PHONE_PRIVATE },
+       { XML_NAMESPACE_TEXT, XML_SENDER_PHONE_PRIVATE, 
XML_TOK_TEXT_SENDER_PHONE_PRIVATE },
        { XML_NAMESPACE_TEXT, XML_SENDER_FAX, XML_TOK_TEXT_SENDER_FAX },
        { XML_NAMESPACE_TEXT, XML_SENDER_COMPANY, XML_TOK_TEXT_SENDER_COMPANY },
-       { XML_NAMESPACE_TEXT, XML_SENDER_PHONE_WORK,
-         XML_TOK_TEXT_SENDER_PHONE_WORK },
+       { XML_NAMESPACE_TEXT, XML_SENDER_PHONE_WORK, 
XML_TOK_TEXT_SENDER_PHONE_WORK },
        { XML_NAMESPACE_TEXT, XML_SENDER_STREET, XML_TOK_TEXT_SENDER_STREET },
        { XML_NAMESPACE_TEXT, XML_SENDER_CITY, XML_TOK_TEXT_SENDER_CITY },
-       { XML_NAMESPACE_TEXT, XML_SENDER_POSTAL_CODE,
-         XML_TOK_TEXT_SENDER_POSTAL_CODE },
+       { XML_NAMESPACE_TEXT, XML_SENDER_POSTAL_CODE, 
XML_TOK_TEXT_SENDER_POSTAL_CODE },
        { XML_NAMESPACE_TEXT, XML_SENDER_COUNTRY, XML_TOK_TEXT_SENDER_COUNTRY },
        { XML_NAMESPACE_TEXT, XML_SENDER_STATE_OR_PROVINCE,
          XML_TOK_TEXT_SENDER_STATE_OR_PROVINCE },
@@ -275,10 +268,8 @@ static __FAR_DATA SvXMLTokenMapEntry aTe
        // misc fields
        { XML_NAMESPACE_TEXT, XML_PLACEHOLDER, XML_TOK_TEXT_PLACEHOLDER },
        { XML_NAMESPACE_TEXT, XML_HIDDEN_TEXT, XML_TOK_TEXT_HIDDEN_TEXT },
-       { XML_NAMESPACE_TEXT, XML_HIDDEN_PARAGRAPH,
-         XML_TOK_TEXT_HIDDEN_PARAGRAPH },
-       { XML_NAMESPACE_TEXT, XML_CONDITIONAL_TEXT,
-         XML_TOK_TEXT_CONDITIONAL_TEXT },
+       { XML_NAMESPACE_TEXT, XML_HIDDEN_PARAGRAPH, 
XML_TOK_TEXT_HIDDEN_PARAGRAPH },
+       { XML_NAMESPACE_TEXT, XML_CONDITIONAL_TEXT, 
XML_TOK_TEXT_CONDITIONAL_TEXT },
        { XML_NAMESPACE_TEXT, XML_FILE_NAME, XML_TOK_TEXT_FILENAME },
        { XML_NAMESPACE_TEXT, XML_CHAPTER,      XML_TOK_TEXT_CHAPTER },
        { XML_NAMESPACE_TEXT, XML_TEMPLATE_NAME, XML_TOK_TEXT_TEMPLATENAME },
@@ -297,10 +288,10 @@ static __FAR_DATA SvXMLTokenMapEntry aTe
        { XML_NAMESPACE_TEXT, XML_BOOKMARK_REF, XML_TOK_TEXT_BOOKMARK_REF },
        { XML_NAMESPACE_TEXT, XML_SEQUENCE_REF, XML_TOK_TEXT_SEQUENCE_REF },
        { XML_NAMESPACE_TEXT, XML_NOTE_REF, XML_TOK_TEXT_NOTE_REF },
-       { XML_NAMESPACE_TEXT, XML_BIBLIOGRAPHY_MARK,
-         XML_TOK_TEXT_BIBLIOGRAPHY_MARK },
+       { XML_NAMESPACE_TEXT, XML_BIBLIOGRAPHY_MARK, 
XML_TOK_TEXT_BIBLIOGRAPHY_MARK },
        { XML_NAMESPACE_OFFICE, XML_ANNOTATION, XML_TOK_TEXT_ANNOTATION },
-       { XML_NAMESPACE_TEXT, XML_SCRIPT, XML_TOK_TEXT_SCRIPT },
+    { XML_NAMESPACE_OFFICE, XML_ANNOTATION_END, XML_TOK_TEXT_ANNOTATION_END },
+    { XML_NAMESPACE_TEXT, XML_SCRIPT, XML_TOK_TEXT_SCRIPT },
     { XML_NAMESPACE_TEXT, XML_TABLE_FORMULA, XML_TOK_TEXT_TABLE_FORMULA },
     { XML_NAMESPACE_TEXT, XML_DROPDOWN, XML_TOK_TEXT_DROPDOWN },
 
@@ -516,6 +507,7 @@ static __FAR_DATA SvXMLTokenMapEntry aTe
     { XML_NAMESPACE_TEXT, XML_CURRENT_VALUE,
                 XML_TOK_TEXTFIELD_CURRENT_VALUE },
     { XML_NAMESPACE_TEXT, XML_TABLE_TYPE, XML_TOK_TEXTFIELD_TABLE_TYPE },
+    { XML_NAMESPACE_OFFICE, XML_NAME, XML_TOK_TEXT_NAME },
 
     XML_TOKEN_MAP_END
 };

Modified: openoffice/branches/rejuvenate01/main/xmloff/source/text/txtparae.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/xmloff/source/text/txtparae.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/xmloff/source/text/txtparae.cxx 
(original)
+++ openoffice/branches/rejuvenate01/main/xmloff/source/text/txtparae.cxx Fri 
Jan  3 14:44:44 2014
@@ -2215,156 +2215,169 @@ void XMLTextParagraphExport::exportParag
 }
 
 void XMLTextParagraphExport::exportTextRangeEnumeration(
-               const Reference < XEnumeration > & rTextEnum,
-               sal_Bool bAutoStyles, sal_Bool bIsProgress,
-               sal_Bool bPrvChrIsSpc )
+    const Reference < XEnumeration > & rTextEnum,
+    sal_Bool bAutoStyles,
+    sal_Bool bIsProgress,
+    sal_Bool bPrvChrIsSpc )
 {
     static OUString sMeta(RTL_CONSTASCII_USTRINGPARAM("InContentMetadata"));
-       sal_Bool bPrevCharIsSpace = bPrvChrIsSpc;
+    static OUString sAnnotation(RTL_CONSTASCII_USTRINGPARAM("Annotation"));
+    static OUString 
sAnnotationEnd(RTL_CONSTASCII_USTRINGPARAM("AnnotationEnd"));
 
-       while( rTextEnum->hasMoreElements() )
-       {
-               Reference<XPropertySet> xPropSet(rTextEnum->nextElement(), 
UNO_QUERY);
+    sal_Bool bPrevCharIsSpace = bPrvChrIsSpc;
+
+    while( rTextEnum->hasMoreElements() )
+    {
+        Reference<XPropertySet> xPropSet(rTextEnum->nextElement(), UNO_QUERY);
         Reference < XTextRange > xTxtRange(xPropSet, uno::UNO_QUERY);
-               Reference<XPropertySetInfo> 
xPropInfo(xPropSet->getPropertySetInfo());
+        Reference<XPropertySetInfo> xPropInfo(xPropSet->getPropertySetInfo());
 
-               if (xPropInfo->hasPropertyByName(sTextPortionType))
-               {
+        if (xPropInfo->hasPropertyByName(sTextPortionType))
+        {
             rtl::OUString sType;
-                       xPropSet->getPropertyValue(sTextPortionType) >>= sType;
+            xPropSet->getPropertyValue(sTextPortionType) >>= sType;
 
-                       if( sType.equals(sText))
-                       {
-                               exportTextRange( xTxtRange, bAutoStyles,
-                                                                
bPrevCharIsSpace );
-                       }
-                       else if( sType.equals(sTextField))
-                       {
+            if( sType.equals(sText))
+            {
+                exportTextRange( xTxtRange, bAutoStyles, bPrevCharIsSpace );
+            }
+            else if( sType.equals(sTextField))
+            {
                 exportTextField( xTxtRange, bAutoStyles, bIsProgress );
-                               bPrevCharIsSpace = sal_False;
-                       }
-                       else if( sType.equals( sFrame ) )
-                       {
-                               Reference < XEnumeration> xContentEnum;
-                               Reference < XContentEnumerationAccess > xCEA( 
xTxtRange,
-                                                                               
                                          UNO_QUERY );
-                               if( xCEA.is() )
-                                       
xContentEnum.set(xCEA->createContentEnumeration(
-                                                                               
                        sTextContentService ));
-                               // frames are never in sections
-                               Reference<XTextSection> xSection;
-                               if( xContentEnum.is() )
-                                       exportTextContentEnumeration( 
xContentEnum,
-                                                                               
                  bAutoStyles,
-                                                                               
                  xSection, bIsProgress, sal_True,
-                                                                               
                  &xPropSet     );
+                bPrevCharIsSpace = false;
+            }
+            else if ( sType.equals( sAnnotation ) )
+            {
+                exportTextField( xTxtRange, bAutoStyles, bIsProgress );
+                bPrevCharIsSpace = false;
+            }
+            else if ( sType.equals( sAnnotationEnd ) )
+            {
+                Reference<XNamed> 
xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
+                const OUString& rName = xBookmark->getName();
+                if ( rName.getLength() > 0 )
+                {
+                    GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, 
rName);
+                }
+                SvXMLElementExport aElem( GetExport(), !bAutoStyles, 
XML_NAMESPACE_OFFICE, XML_ANNOTATION_END, sal_False, sal_False );
+            }
+            else if( sType.equals( sFrame ) )
+            {
+                Reference < XEnumeration> xContentEnum;
+                Reference < XContentEnumerationAccess > xCEA( xTxtRange, 
UNO_QUERY );
+                if( xCEA.is() )
+                    xContentEnum.set(xCEA->createContentEnumeration( 
sTextContentService ));
+                // frames are never in sections
+                Reference<XTextSection> xSection;
+                if( xContentEnum.is() )
+                    exportTextContentEnumeration(
+                    xContentEnum,
+                    bAutoStyles,
+                    xSection,
+                    bIsProgress,
+                    sal_True,
+                    &xPropSet );
 
-                               bPrevCharIsSpace = sal_False;
-                       }
-                       else if (sType.equals(sFootnote))
-                       {
-                               exportTextFootnote(xPropSet,
-                                                                  
xTxtRange->getString(),
-                                                                  bAutoStyles, 
bIsProgress );
-                               bPrevCharIsSpace = sal_False;
-                       }
-                       else if (sType.equals(sBookmark))
-                       {
-                               exportTextMark(xPropSet,
-                                                          sBookmark,
-                                                          
lcl_XmlBookmarkElements,
-                                                          bAutoStyles);
-                       }
-                       else if (sType.equals(sReferenceMark))
-                       {
-                               exportTextMark(xPropSet,
-                                                          sReferenceMark,
-                                                          
lcl_XmlReferenceElements,
-                                                          bAutoStyles);
-                       }
-                       else if (sType.equals(sDocumentIndexMark))
-                       {
-                               pIndexMarkExport->ExportIndexMark(xPropSet,     
bAutoStyles);
-                       }
-                       else if (sType.equals(sRedline))
-                       {
-                               if (NULL != pRedlineExport)
-                                       pRedlineExport->ExportChange(xPropSet, 
bAutoStyles);
-                       }
-                       else if (sType.equals(sRuby))
-                       {
-                               exportRuby(xPropSet, bAutoStyles);
-                       }
+                bPrevCharIsSpace = sal_False;
+            }
+            else if (sType.equals(sFootnote))
+            {
+                exportTextFootnote( xPropSet, xTxtRange->getString(), 
bAutoStyles, bIsProgress );
+                bPrevCharIsSpace = sal_False;
+            }
+            else if (sType.equals(sBookmark))
+            {
+                exportTextMark( xPropSet, sBookmark, lcl_XmlBookmarkElements, 
bAutoStyles );
+            }
+            else if (sType.equals(sReferenceMark))
+            {
+                exportTextMark( xPropSet, sReferenceMark, 
lcl_XmlReferenceElements, bAutoStyles);
+            }
+            else if (sType.equals(sDocumentIndexMark))
+            {
+                pIndexMarkExport->ExportIndexMark( xPropSet, bAutoStyles);
+            }
+            else if (sType.equals(sRedline))
+            {
+                if (NULL != pRedlineExport)
+                    pRedlineExport->ExportChange( xPropSet, bAutoStyles );
+            }
+            else if (sType.equals(sRuby))
+            {
+                exportRuby( xPropSet, bAutoStyles );
+            }
             else if (sType.equals(sMeta))
             {
-                exportMeta(xPropSet, bAutoStyles, bIsProgress);
+                exportMeta( xPropSet, bAutoStyles, bIsProgress );
             }
-                       else if (sType.equals(sTextFieldStart))
-                       {
-                               Reference<XNamed> 
xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
-                               if (xBookmark.is())
+            else if (sType.equals(sTextFieldStart))
+            {
+                Reference<XNamed> 
xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
+                if (xBookmark.is())
                 {
-                                       
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName());
-                               }
-                               Reference< ::com::sun::star::text::XFormField > 
xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
-                               if (xFormField.is())
+                    GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, 
xBookmark->getName());
+                }
+
+                Reference< ::com::sun::star::text::XFormField > 
xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
+                if (xFormField.is())
                 {
-                                       
GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, 
xFormField->getFieldType());
-                               }
-                               GetExport().StartElement(XML_NAMESPACE_FIELD, 
XML_FIELDMARK_START, sal_False);
-                               if (xFormField.is())
+                    GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, 
xFormField->getFieldType());
+                }
+
+                GetExport().StartElement(XML_NAMESPACE_FIELD, 
XML_FIELDMARK_START, sal_False);
+                if (xFormField.is())
                 {
                     FieldParamExporter(&GetExport(), 
xFormField->getParameters()).Export();
-                               }
-                               GetExport().EndElement(XML_NAMESPACE_FIELD, 
XML_FIELDMARK_START, sal_False);
-                       }
-                       else if (sType.equals(sTextFieldEnd))
-                       {
-                               GetExport().StartElement(XML_NAMESPACE_FIELD, 
XML_FIELDMARK_END, sal_False);
-                               GetExport().EndElement(XML_NAMESPACE_FIELD, 
XML_FIELDMARK_END, sal_False);
-                       }
-                       else if (sType.equals(sTextFieldStartEnd))
-                       {
-                               Reference<XNamed> 
xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
-                               if (xBookmark.is())
+                }
+                GetExport().EndElement(XML_NAMESPACE_FIELD, 
XML_FIELDMARK_START, sal_False);
+            }
+            else if (sType.equals(sTextFieldEnd))
+            {
+                GetExport().StartElement(XML_NAMESPACE_FIELD, 
XML_FIELDMARK_END, sal_False);
+                GetExport().EndElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_END, 
sal_False);
+            }
+            else if (sType.equals(sTextFieldStartEnd))
+            {
+                Reference<XNamed> 
xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
+                if (xBookmark.is())
                 {
-                                       
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName());
-                               }
-                               Reference< ::com::sun::star::text::XFormField > 
xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
-                               if (xFormField.is())
+                    GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, 
xBookmark->getName());
+                }
+                Reference< ::com::sun::star::text::XFormField > 
xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
+                if (xFormField.is())
                 {
-                                   
GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, 
xFormField->getFieldType());
-                               }
-                               GetExport().StartElement(XML_NAMESPACE_FIELD, 
XML_FIELDMARK, sal_False);
-                               if (xFormField.is())
+                    GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, 
xFormField->getFieldType());
+                }
+                GetExport().StartElement(XML_NAMESPACE_FIELD, XML_FIELDMARK, 
sal_False);
+                if (xFormField.is())
                 {
                     FieldParamExporter(&GetExport(), 
xFormField->getParameters()).Export();
-                               }
-                               GetExport().EndElement(XML_NAMESPACE_FIELD, 
XML_FIELDMARK, sal_False);
-                       }
-                       else if (sType.equals(sSoftPageBreak))
-                       {
-                               exportSoftPageBreak(xPropSet,   bAutoStyles);
-                       }
-                       else {
-                               DBG_ERROR("unknown text portion type");
+                }
+                GetExport().EndElement(XML_NAMESPACE_FIELD, XML_FIELDMARK, 
sal_False);
             }
-               }
-               else
-               {
-                       Reference<XServiceInfo> xServiceInfo( xTxtRange, 
UNO_QUERY );
-                       if( xServiceInfo->supportsService( sTextFieldService ) )
-                       {
+            else if (sType.equals(sSoftPageBreak))
+            {
+                exportSoftPageBreak(xPropSet,  bAutoStyles);
+            }
+            else {
+                DBG_ERROR("unknown text portion type");
+            }
+        }
+        else
+        {
+            Reference<XServiceInfo> xServiceInfo( xTxtRange, UNO_QUERY );
+            if( xServiceInfo->supportsService( sTextFieldService ) )
+            {
                 exportTextField( xTxtRange, bAutoStyles, bIsProgress );
-                               bPrevCharIsSpace = sal_False;
-                       }
-                       else
-                       {
-                               // no TextPortionType property -> non-Writer 
app -> text
-                               exportTextRange( xTxtRange, bAutoStyles, 
bPrevCharIsSpace );
-                       }
-               }
-       }
+                bPrevCharIsSpace = sal_False;
+            }
+            else
+            {
+                // no TextPortionType property -> non-Writer app -> text
+                exportTextRange( xTxtRange, bAutoStyles, bPrevCharIsSpace );
+            }
+        }
+    }
 
 // now that there are nested enumerations for meta(-field), this may be valid!
 //     DBG_ASSERT( !bOpenRuby, "Red Alert: Ruby still open!" );


Reply via email to