sw/source/filter/ww8/ww8atr.cxx | 2 +- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit 3c75009a677ae950105a65c699b16caf72b516b0 Author: Mark Hung <mark...@gmail.com> Date: Tue Jun 13 23:35:40 2017 +0800 writerfilter: prevent last character of field switch eaten 1. First quotation mark of \B command switch of TOC field command wasn't written when exporting. 2. Quotation mark wasn't ripped off when writerfilter parsing TOC field command. 3. FindInCommand accidently ripped that last character of the last command. Change-Id: If283776048f3c8d896c466cf4d742e44b6d85e96 Reviewed-on: https://gerrit.libreoffice.org/38745 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Mark Hung <mark...@gmail.com> diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 2350dc65091d..15d8b4192bef 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -2065,7 +2065,7 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) } if(SwTOXElement::Bookmark & pTOX->GetCreateType()) { - sStr += "\\b "; + sStr += "\\b \""; OUString bName = pTOX->GetBookmarkName(); sStr += bName; sStr += sEntryEnd; diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index b9ae8738766b..a2205d45f9ff 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2515,7 +2515,7 @@ static bool lcl_FindInCommand( //find next '\' or end of string sal_Int32 nEndIndex = rCommand.indexOf( '\\', nIndex + 1); if( nEndIndex < 0 ) - nEndIndex = rCommand.getLength() - 1; + nEndIndex = rCommand.getLength() ; if( nEndIndex - nIndex > 3 ) rValue = rCommand.copy( nIndex + 3, nEndIndex - nIndex - 3); } @@ -3393,7 +3393,7 @@ void DomainMapper_Impl::handleToc // \b Uses a bookmark to specify area of document from which to build table of contents if( lcl_FindInCommand( pContext->GetCommand(), 'b', sValue )) { - aBookmarkName = sValue; + aBookmarkName = sValue.trim().replaceAll("\"",""); } if( lcl_FindInCommand( pContext->GetCommand(), 'c', sValue )) // \c Builds a table of figures of the given label _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits