no need to use SvLockBytes in forms

Change-Id: Ide586997d504e0fbdb72aa1db77c49ba3d6007c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161437
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2023-12-30 09:49:57 +02:00 committed by Noel Grandin
parent 39d0ab03fd
commit 7de4661827
3 changed files with 7 additions and 10 deletions

View file

@ -938,11 +938,11 @@ void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, std::u16string_vie
pChild->SetContentTransferEncoding("8bit");
// Body
SvMemoryStream* pStream = new SvMemoryStream;
std::unique_ptr<SvMemoryStream> pStream(new SvMemoryStream);
pStream->WriteLine( OUStringToOString(rData, rtl_getTextEncodingFromMimeCharset(pBestMatchingEncoding)) );
pStream->FlushBuffer();
pStream->Seek( 0 );
pChild->SetDocumentLB( new SvLockBytes(pStream, true) );
pChild->SetDocumentLB( std::move(pStream) );
rParent.AttachChild( std::move(pChild) );
}
@ -1001,7 +1001,7 @@ void ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, std::u16string_vie
// Body
pChild->SetDocumentLB( new SvLockBytes(pStream.release(), true) );
pChild->SetDocumentLB( std::move(pStream) );
rParent.AttachChild( std::move(pChild) );
}

View file

@ -77,7 +77,7 @@ class SAL_WARN_UNUSED UNLESS_MERGELIBS(TOOLS_DLLPUBLIC) INetMIMEMessage
::std::vector< std::unique_ptr<INetMessageHeader> >
m_aHeaderList;
SvLockBytesRef m_xDocLB;
std::unique_ptr<SvStream> m_xDocLB;
::std::map<InetMessageMime, sal_uInt32> m_nMIMEIndex;
INetMIMEMessage* pParent;
@ -139,8 +139,8 @@ public:
}
}
SvLockBytes* GetDocumentLB() const { return m_xDocLB.get(); }
void SetDocumentLB (SvLockBytes *pDocLB) { m_xDocLB = pDocLB; }
SvStream* GetDocumentLB() const { return m_xDocLB.get(); }
void SetDocumentLB (std::unique_ptr<SvStream> pDocLB) { m_xDocLB = std::move(pDocLB); }
static bool ParseDateField (
std::u16string_view rDateField, DateTime& rDateTime);

View file

@ -75,10 +75,7 @@ int INetMIMEMessageStream::GetBodyLine(char* pData, sal_uInt32 nSize)
if (pSourceMsg->GetDocumentLB())
{
if (pMsgStrm == nullptr)
pMsgStrm.reset(new SvStream (pSourceMsg->GetDocumentLB()));
sal_uInt32 nRead = pMsgStrm->ReadBytes(pWBuf, (pWEnd - pWBuf));
sal_uInt32 nRead = pSourceMsg->GetDocumentLB()->ReadBytes(pWBuf, (pWEnd - pWBuf));
pWBuf += nRead;
}