diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-07-09 08:21:06 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-07-09 09:23:19 +0200 |
commit | db9e64c2a499c1c3da9d3c1b4e123af04f937933 (patch) | |
tree | 05f33b44ed838406e1822742adc7e206449c1a00 /sw | |
parent | 50637913f1c3f84eae19213d59c271766b2233fe (diff) |
Better support more than 65k annotations
There isn't really a limit for the annotation count in the RTF/DOCX spec.
Thanks Miklos for hints on this.
Change-Id: Ib4493b518acb3cabe04312c37b5c6a9c6072cb7e
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.hxx | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 7d4fc7382fdc..5b022d85f8c2 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1315,7 +1315,7 @@ void DocxAttributeOutput::DoWriteBookmarks() std::map< OString, sal_uInt16 >::iterator pPos = m_rOpenedBookmarksIds.find( rName ); if ( pPos != m_rOpenedBookmarksIds.end( ) ) { - sal_uInt16 nId = ( *pPos ).second; + const sal_Int32 nId = ( *pPos ).second; m_pSerializer->singleElementNS( XML_w, XML_bookmarkEnd, FSNS( XML_w, XML_id ), OString::number( nId ).getStr( ), FSEND ); @@ -1341,7 +1341,7 @@ void DocxAttributeOutput::DoWriteAnnotationMarks() */ if ( m_rOpenedAnnotationMarksIds.end() == m_rOpenedAnnotationMarksIds.find( rName ) ) { - sal_uInt16 nId = m_nNextAnnotationMarkId++; + const sal_Int32 nId = m_nNextAnnotationMarkId++; m_rOpenedAnnotationMarksIds[rName] = nId; m_pSerializer->singleElementNS( XML_w, XML_commentRangeStart, FSNS( XML_w, XML_id ), OString::number( nId ).getStr( ), @@ -1358,10 +1358,10 @@ void DocxAttributeOutput::DoWriteAnnotationMarks() const OString& rName = *it; // Get the id of the annotation mark - std::map< OString, sal_uInt16 >::iterator pPos = m_rOpenedAnnotationMarksIds.find( rName ); + std::map< OString, sal_Int32 >::iterator pPos = m_rOpenedAnnotationMarksIds.find( rName ); if ( pPos != m_rOpenedAnnotationMarksIds.end( ) ) { - sal_uInt16 nId = ( *pPos ).second; + const sal_Int32 nId = ( *pPos ).second; m_pSerializer->singleElementNS( XML_w, XML_commentRangeEnd, FSNS( XML_w, XML_id ), OString::number( nId ).getStr( ), FSEND ); @@ -6528,7 +6528,7 @@ void DocxAttributeOutput::PostitField( const SwField* pField ) const SwPostItField* pPostItField = static_cast<const SwPostItField*>(pField); OString aName = OUStringToOString(pPostItField->GetName(), RTL_TEXTENCODING_UTF8); sal_Int32 nId = 0; - std::map< OString, sal_uInt16 >::iterator it = m_rOpenedAnnotationMarksIds.find(aName); + std::map< OString, sal_Int32 >::iterator it = m_rOpenedAnnotationMarksIds.find(aName); if (it != m_rOpenedAnnotationMarksIds.end()) // If the postit field has an annotation mark associated, we already have an id. nId = it->second; @@ -6547,7 +6547,7 @@ void DocxAttributeOutput::WritePostitFieldReference() // In case this file is inside annotation marks, we want to write the // comment reference after the annotation mark is closed, not here. OString idname = OUStringToOString(m_postitFields[m_postitFieldsMaxId].first->GetName(), RTL_TEXTENCODING_UTF8); - std::map< OString, sal_uInt16 >::iterator it = m_rOpenedAnnotationMarksIds.find( idname ); + std::map< OString, sal_Int32 >::iterator it = m_rOpenedAnnotationMarksIds.find( idname ); if ( it == m_rOpenedAnnotationMarksIds.end( ) ) m_pSerializer->singleElementNS( XML_w, XML_commentReference, FSNS( XML_w, XML_id ), idstr.getStr(), FSEND ); ++m_postitFieldsMaxId; diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 04d745ec7ac8..c0cf834a2008 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -782,7 +782,7 @@ private: OString m_sLastOpenedBookmark; /// Maps of the annotation marks ids - std::map<OString, sal_uInt16> m_rOpenedAnnotationMarksIds; + std::map<OString, sal_Int32> m_rOpenedAnnotationMarksIds; /// Name of the last opened annotation mark. OString m_sLastOpenedAnnotationMark; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index e374a9a0afe6..9d164f88b203 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1490,7 +1490,7 @@ void RtfAttributeOutput::WriteAnnotationMarks_Impl(std::vector< OUString >& rSta OString rName = OUStringToOString(*i, RTL_TEXTENCODING_UTF8); // Output the annotation mark - sal_uInt16 nId = m_nNextAnnotationMarkId++; + const sal_Int32 nId = m_nNextAnnotationMarkId++; m_rOpenedAnnotationMarksIds[rName] = nId; m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATRFSTART " "); m_aRun->append(OString::number(nId).getStr()); @@ -1503,10 +1503,10 @@ void RtfAttributeOutput::WriteAnnotationMarks_Impl(std::vector< OUString >& rSta OString rName = OUStringToOString(*i, RTL_TEXTENCODING_UTF8); // Get the id of the annotation mark - std::map<OString, sal_uInt16>::iterator it = m_rOpenedAnnotationMarksIds.find(rName); + std::map<OString, sal_Int32>::iterator it = m_rOpenedAnnotationMarksIds.find(rName); if (it != m_rOpenedAnnotationMarksIds.end()) { - sal_uInt16 nId = it->second; + const sal_Int32 nId = it->second; m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATRFEND " "); m_aRun->append(OString::number(nId).getStr()); m_aRun->append('}'); @@ -3292,7 +3292,7 @@ void RtfAttributeOutput::PostitField(const SwField* pField) const SwPostItField& rPField = *static_cast<const SwPostItField*>(pField); OString aName = OUStringToOString(rPField.GetName(), RTL_TEXTENCODING_UTF8); - std::map<OString, sal_uInt16>::iterator it = m_rOpenedAnnotationMarksIds.find(aName); + std::map<OString, sal_Int32>::iterator it = m_rOpenedAnnotationMarksIds.find(aName); if (it != m_rOpenedAnnotationMarksIds.end()) { // In case this field is inside annotation marks, we want to write the diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 0696486244b9..076fdaf9d7ac 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -515,7 +515,7 @@ private: sal_Int32 m_nNextAnnotationMarkId; sal_Int32 m_nCurrentAnnotationMarkId; /// Maps annotation mark names to ID's. - std::map<OString, sal_uInt16> m_rOpenedAnnotationMarksIds; + std::map<OString, sal_Int32> m_rOpenedAnnotationMarksIds; /* * The current table helper. |