From ccf14962edf5cb1cf650363c876f6460e9403ccf Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 30 Jul 2018 12:00:13 +0200 Subject: fix bug in SwXMLTextBlocks::CopyBlock would have created a name that looked like xxxx123456789101112 etc, which is probably not what it wanted Change-Id: I4ebdf1444fc12d57762463075ca0dea2cc046dd7 Reviewed-on: https://gerrit.libreoffice.org/58309 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/swg/SwXMLTextBlocks.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index eed2272a3ad5..2f22f88f8b3d 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -238,7 +238,8 @@ ErrCode SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, OUString& rShort, const OUString aGroup( rShort ); bool bTextOnly = IsOnlyTextBlock ( rShort ) ;//pImp->pBlkRoot->IsStream( aGroup ); sal_uInt16 nIndex = GetIndex ( rShort ); - OUString sDestShortName( GetPackageName (nIndex) ); + OUString sPackageName( GetPackageName (nIndex) ); + OUString sDestShortName( sPackageName ); sal_uInt16 nIdx = 0; OSL_ENSURE( xBlkRoot.is(), "No storage set" ); @@ -256,7 +257,7 @@ ErrCode SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, OUString& rShort, rDestImp.CloseFile(); return ERR_SWG_WRITE_ERROR; } - sDestShortName += OUString::number( nIdx ); + sDestShortName = sPackageName + OUString::number( nIdx ); } try -- cgit