Kaydet (Commit) f27e7582 authored tarafından Oliver-Rainer Wittmann's avatar Oliver-Rainer Wittmann

125215: *.docx import: Bookmark ID has to be treated as an Integer

üst 87637364
......@@ -1413,18 +1413,21 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
case NS_rtf::LN_endnote:
/* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
break;
case NS_rtf::LN_BOOKMARKNAME:
/* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
// sStringValue contains the bookmark name
sLocalBookmarkName = sStringValue;
break;
case NS_rtf::LN_IBKL:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0.5 */
//contains the bookmark identifier - has to be added to the bookmark name imported before
//if it is already available then the bookmark should be inserted
m_pImpl->AddBookmark( sLocalBookmarkName, sStringValue );
m_pImpl->AddBookmark( sLocalBookmarkName, nIntValue );
sLocalBookmarkName = ::rtl::OUString();
break;
case NS_rtf::LN_LISTLEVEL:
/* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
break;
......
......@@ -3541,10 +3541,12 @@ void DomainMapper_Impl::PopFieldContext()
/*-- 11.06.2007 16:19:00---------------------------------------------------
-----------------------------------------------------------------------*/
void DomainMapper_Impl::AddBookmark( const ::rtl::OUString& rBookmarkName, const ::rtl::OUString& rId )
void DomainMapper_Impl::AddBookmark(
const ::rtl::OUString& rBookmarkName,
const sal_Int32 nId )
{
uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
BookmarkMap_t::iterator aBookmarkIter = m_aBookmarkMap.find( rId );
BookmarkMap_t::iterator aBookmarkIter = m_aBookmarkMap.find( nId );
//is the bookmark name already registered?
try
{
......@@ -3575,7 +3577,7 @@ void DomainMapper_Impl::AddBookmark( const ::rtl::OUString& rBookmarkName, const
uno::Reference< text::XTextCursor > xCursor = xTextAppend->createTextCursorByRange( xTextAppend->getEnd() );
bool bIsStart = !xCursor->goLeft(1, false);
uno::Reference< text::XTextRange > xCurrent = xCursor->getStart();
m_aBookmarkMap.insert(BookmarkMap_t::value_type( rId, BookmarkInsertPosition( bIsStart, rBookmarkName, xCurrent ) ));
m_aBookmarkMap.insert(BookmarkMap_t::value_type( nId, BookmarkInsertPosition( bIsStart, rBookmarkName, xCurrent ) ));
}
}
catch( const uno::Exception& )
......
......@@ -289,7 +289,7 @@ class DomainMapper_Impl
public:
typedef TableManager< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >, PropertyMapPtr > TableManager_t;
typedef TableDataHandler< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >, TablePropertyMapPtr > TableDataHandler_t;
typedef std::map < ::rtl::OUString, BookmarkInsertPosition > BookmarkMap_t;
typedef std::map < sal_Int32, BookmarkInsertPosition > BookmarkMap_t;
private:
SourceDocumentType m_eDocumentType;
......@@ -554,7 +554,9 @@ public:
//the end of field is reached (0x15 appeared) - the command might still be open
void PopFieldContext();
void AddBookmark( const ::rtl::OUString& rBookmarkName, const ::rtl::OUString& rId );
void AddBookmark(
const ::rtl::OUString& rBookmarkName,
const sal_Int32 nId );
void AddAnnotationPosition(
const bool bStart,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment