Kaydet (Commit) a4688cde authored tarafından Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer Kaydeden (comit) Caolán McNamara

mail merge: properly increment indexing counter (was const)

Change-Id: I1d780a5369c04a93e7fe16b41bff5f37d641e60c
Reviewed-on: https://gerrit.libreoffice.org/4857Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst becbe844
......@@ -1289,21 +1289,22 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
// printing should be done synchronously otherwise the document
// might already become invalid during the process
uno::Sequence< beans::PropertyValue > aOptions( rMergeDescriptor.aPrintOptions );
const sal_Int32 nOpts = aOptions.getLength();
aOptions.realloc( nOpts + 1 );
aOptions[ nOpts ].Name = OUString("Wait");
aOptions[ nOpts ].Value <<= sal_True ;
aOptions.realloc( 1 );
aOptions[ 0 ].Name = OUString("Wait");
aOptions[ 0 ].Value <<= sal_True ;
// move print options
const beans::PropertyValue* pPrintOptions = rMergeDescriptor.aPrintOptions.getConstArray();
for( sal_Int32 nOption = 0; nOption < rMergeDescriptor.aPrintOptions.getLength(); ++nOption)
for( sal_Int32 nOption = 0, nIndex = 1 ; nOption < rMergeDescriptor.aPrintOptions.getLength(); ++nOption)
{
if( pPrintOptions[nOption].Name == "CopyCount" || pPrintOptions[nOption].Name == "FileName"
|| pPrintOptions[nOption].Name == "Collate" || pPrintOptions[nOption].Name == "Pages"
|| pPrintOptions[nOption].Name == "Wait" )
{
aOptions.realloc( nOpts + 1 );
aOptions[ nOpts ].Name = pPrintOptions[nOption].Name;
aOptions[ nOpts ].Value = pPrintOptions[nOption].Value ;
// add an option
aOptions.realloc( nIndex + 1 );
aOptions[ nIndex ].Name = pPrintOptions[nOption].Name;
aOptions[ nIndex++ ].Value = pPrintOptions[nOption].Value ;
}
}
......
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