Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
c414389e
Kaydet (Commit)
c414389e
authored
Tem 05, 2014
tarafından
Takeshi Abe
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoid possible memory leaks in case of exceptions
Change-Id: I46d49b515f5212a34612e80a82a3330a041b956c
üst
6a9d51b2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
39 deletions
+24
-39
ehdl.cxx
svtools/source/misc/ehdl.cxx
+8
-12
embedhlp.cxx
svtools/source/misc/embedhlp.cxx
+4
-6
imap.cxx
svtools/source/misc/imap.cxx
+3
-9
transfer.cxx
svtools/source/misc/transfer.cxx
+9
-12
No files found.
svtools/source/misc/ehdl.cxx
Dosyayı görüntüle @
c414389e
...
...
@@ -28,7 +28,7 @@
#include <svtools/svtresid.hxx>
#include <svtools/svtools.hrc>
#include <svtools/sfxecode.hxx>
#include <boost/scoped_ptr.hpp>
static
sal_uInt16
aWndFunc
(
...
...
@@ -89,29 +89,28 @@ static sal_uInt16 aWndFunc(
aErr
=
aErr
.
replaceAll
(
"$(ACTION)"
,
aAction
);
aErr
=
aErr
.
replaceAll
(
"$(ERROR)"
,
rErr
);
MessBox
*
pBox
;
boost
::
scoped_ptr
<
MessBox
>
pBox
;
switch
(
nFlags
&
0xf000
)
{
case
ERRCODE_MSG_ERROR
:
pBox
=
new
ErrorBox
(
pWin
,
eBits
,
aErr
);
pBox
.
reset
(
new
ErrorBox
(
pWin
,
eBits
,
aErr
)
);
break
;
case
ERRCODE_MSG_WARNING
:
pBox
=
new
WarningBox
(
pWin
,
eBits
,
aErr
);
pBox
.
reset
(
new
WarningBox
(
pWin
,
eBits
,
aErr
)
);
break
;
case
ERRCODE_MSG_INFO
:
pBox
=
new
InfoBox
(
pWin
,
aErr
);
pBox
.
reset
(
new
InfoBox
(
pWin
,
aErr
)
);
break
;
case
ERRCODE_MSG_QUERY
:
pBox
=
new
QueryBox
(
pWin
,
eBits
,
aErr
);
pBox
.
reset
(
new
QueryBox
(
pWin
,
eBits
,
aErr
)
);
break
;
default
:
{
SAL_WARN
(
"svtools.misc"
,
"no MessBox type"
);
pBox
=
NULL
;
return
ERRCODE_BUTTON_OK
;
}
}
...
...
@@ -138,7 +137,6 @@ static sal_uInt16 aWndFunc(
SAL_WARN
(
"svtools.misc"
,
"Unknown MessBox return value"
);
break
;
}
delete
pBox
;
return
nRet
;
}
...
...
@@ -278,7 +276,7 @@ bool SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr) const
{
bool
bRet
=
false
;
ResMgr
*
pResMgr
=
ResMgr
::
CreateResMgr
(
"ofa"
,
Application
::
GetSettings
().
GetUILanguageTag
()
);
boost
::
scoped_ptr
<
ResMgr
>
pResMgr
(
ResMgr
::
CreateResMgr
(
"ofa"
,
Application
::
GetSettings
().
GetUILanguageTag
()
)
);
if
(
pResMgr
)
{
ResId
aId
(
RID_ERRHDL
,
*
pResMgr
);
...
...
@@ -289,7 +287,6 @@ bool SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr) const
bRet
=
true
;
}
}
delete
pResMgr
;
return
bRet
;
}
...
...
@@ -306,7 +303,7 @@ bool SfxErrorHandler::GetMessageString(
{
bool
bRet
=
false
;
ResId
*
pResId
=
new
ResId
(
nId
,
*
pMgr
);
boost
::
scoped_ptr
<
ResId
>
pResId
(
new
ResId
(
nId
,
*
pMgr
)
);
ErrorResource_Impl
aEr
(
*
pResId
,
(
sal_uInt16
)
lErrId
);
if
(
aEr
)
...
...
@@ -319,7 +316,6 @@ bool SfxErrorHandler::GetMessageString(
bRet
=
true
;
}
delete
pResId
;
return
bRet
;
}
...
...
svtools/source/misc/embedhlp.cxx
Dosyayı görüntüle @
c414389e
...
...
@@ -49,6 +49,7 @@
#include <cppuhelper/implbase4.hxx>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
#include <boost/scoped_ptr.hpp>
using
namespace
com
::
sun
::
star
;
...
...
@@ -432,14 +433,13 @@ void EmbeddedObjectRef::GetReplacement( bool bUpdate )
return
;
}
SvStream
*
pGraphicStream
=
GetGraphicStream
(
bUpdate
);
boost
::
scoped_ptr
<
SvStream
>
pGraphicStream
(
GetGraphicStream
(
bUpdate
)
);
if
(
pGraphicStream
)
{
GraphicFilter
&
rGF
=
GraphicFilter
::
GetGraphicFilter
();
if
(
mpImpl
->
pGraphic
)
rGF
.
ImportGraphic
(
*
mpImpl
->
pGraphic
,
OUString
(),
*
pGraphicStream
,
GRFILTER_FORMAT_DONTKNOW
);
mpImpl
->
mnGraphicVersion
++
;
delete
pGraphicStream
;
}
}
...
...
@@ -531,7 +531,7 @@ void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream
mpImpl
->
aMediaType
=
rMediaType
;
mpImpl
->
mnGraphicVersion
++
;
SvStream
*
pGraphicStream
=
::
utl
::
UcbStreamHelper
::
CreateStream
(
xInGrStream
);
boost
::
scoped_ptr
<
SvStream
>
pGraphicStream
(
::
utl
::
UcbStreamHelper
::
CreateStream
(
xInGrStream
)
);
if
(
pGraphicStream
)
{
...
...
@@ -542,12 +542,10 @@ void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream
if
(
mpImpl
->
pContainer
)
{
pGraphicStream
->
Seek
(
0
);
uno
::
Reference
<
io
::
XInputStream
>
xInSeekGrStream
=
new
::
utl
::
OSeekableInputStreamWrapper
(
pGraphicStream
);
uno
::
Reference
<
io
::
XInputStream
>
xInSeekGrStream
=
new
::
utl
::
OSeekableInputStreamWrapper
(
pGraphicStream
.
get
()
);
mpImpl
->
pContainer
->
InsertGraphicStream
(
xInSeekGrStream
,
mpImpl
->
aPersistName
,
rMediaType
);
}
delete
pGraphicStream
;
}
mpImpl
->
bNeedUpdate
=
false
;
...
...
svtools/source/misc/imap.cxx
Dosyayı görüntüle @
c414389e
...
...
@@ -32,7 +32,7 @@
#include <string.h>
#include <math.h>
#include <boost/scoped_ptr.hpp>
#define SCALEPOINT(aPT,aFracX,aFracY) (aPT).X()=((aPT).X()*(aFracX).GetNumerator())/(aFracX).GetDenominator(); \
...
...
@@ -78,7 +78,6 @@ sal_uInt16 IMapObject::GetVersion() const
void
IMapObject
::
Write
(
SvStream
&
rOStm
,
const
OUString
&
rBaseURL
)
const
{
IMapCompat
*
pCompat
;
const
rtl_TextEncoding
eEncoding
=
osl_getThreadTextEncoding
();
rOStm
.
WriteUInt16
(
GetType
()
);
...
...
@@ -92,13 +91,11 @@ void IMapObject::Write( SvStream& rOStm, const OUString& rBaseURL ) const
rOStm
.
WriteUChar
(
bActive
);
write_uInt16_lenPrefixed_uInt8s_FromOUString
(
rOStm
,
aTarget
,
eEncoding
);
pCompat
=
new
IMapCompat
(
rOStm
,
STREAM_WRITE
);
boost
::
scoped_ptr
<
IMapCompat
>
pCompat
(
new
IMapCompat
(
rOStm
,
STREAM_WRITE
)
);
WriteIMapObject
(
rOStm
);
aEventList
.
Write
(
rOStm
);
// V4
write_uInt16_lenPrefixed_uInt8s_FromOUString
(
rOStm
,
aName
,
eEncoding
);
// V5
delete
pCompat
;
}
...
...
@@ -110,7 +107,6 @@ void IMapObject::Write( SvStream& rOStm, const OUString& rBaseURL ) const
void
IMapObject
::
Read
(
SvStream
&
rIStm
,
const
OUString
&
rBaseURL
)
{
IMapCompat
*
pCompat
;
rtl_TextEncoding
nTextEncoding
;
// read on type and version
...
...
@@ -124,7 +120,7 @@ void IMapObject::Read( SvStream& rIStm, const OUString& rBaseURL )
// make URL absolute
aURL
=
URIHelper
::
SmartRel2Abs
(
INetURLObject
(
rBaseURL
),
aURL
,
URIHelper
::
GetMaybeFileHdl
(),
true
,
false
,
INetURLObject
::
WAS_ENCODED
,
INetURLObject
::
DECODE_UNAMBIGUOUS
);
pCompat
=
new
IMapCompat
(
rIStm
,
STREAM_READ
);
boost
::
scoped_ptr
<
IMapCompat
>
pCompat
(
new
IMapCompat
(
rIStm
,
STREAM_READ
)
);
ReadIMapObject
(
rIStm
);
...
...
@@ -137,8 +133,6 @@ void IMapObject::Read( SvStream& rIStm, const OUString& rBaseURL )
if
(
nReadVersion
>=
0x0005
)
aName
=
read_uInt16_lenPrefixed_uInt8s_ToOUString
(
rIStm
,
nTextEncoding
);
}
delete
pCompat
;
}
bool
IMapObject
::
IsEqual
(
const
IMapObject
&
rEqObj
)
...
...
svtools/source/misc/transfer.cxx
Dosyayı görüntüle @
c414389e
...
...
@@ -59,7 +59,7 @@
#include <vcl/dibtools.hxx>
#include <vcl/pngread.hxx>
#include <vcl/pngwrite.hxx>
#include <boost/scoped_ptr.hpp>
// - Namespaces -
...
...
@@ -351,11 +351,11 @@ Any SAL_CALL TransferableHelper::getTransferData2( const DataFlavor& rFlavor, co
if
(
maAny
>>=
aSeq
)
{
SvMemoryStream
*
pSrcStm
=
new
SvMemoryStream
(
(
char
*
)
aSeq
.
getConstArray
(),
aSeq
.
getLength
(),
STREAM_WRITE
|
STREAM_TRUNC
);
boost
::
scoped_ptr
<
SvMemoryStream
>
pSrcStm
(
new
SvMemoryStream
(
(
char
*
)
aSeq
.
getConstArray
(),
aSeq
.
getLength
(),
STREAM_WRITE
|
STREAM_TRUNC
)
);
GDIMetaFile
aMtf
;
ReadGDIMetaFile
(
*
pSrcStm
,
aMtf
);
delete
pSrcStm
;
pSrcStm
.
reset
()
;
Graphic
aGraphic
(
aMtf
);
SvMemoryStream
aDstStm
(
65535
,
65535
);
...
...
@@ -381,11 +381,11 @@ Any SAL_CALL TransferableHelper::getTransferData2( const DataFlavor& rFlavor, co
if
(
maAny
>>=
aSeq
)
{
SvMemoryStream
*
pSrcStm
=
new
SvMemoryStream
(
(
char
*
)
aSeq
.
getConstArray
(),
aSeq
.
getLength
(),
STREAM_WRITE
|
STREAM_TRUNC
);
boost
::
scoped_ptr
<
SvMemoryStream
>
pSrcStm
(
new
SvMemoryStream
(
(
char
*
)
aSeq
.
getConstArray
(),
aSeq
.
getLength
(),
STREAM_WRITE
|
STREAM_TRUNC
)
);
GDIMetaFile
aMtf
;
ReadGDIMetaFile
(
*
pSrcStm
,
aMtf
);
delete
pSrcStm
;
pSrcStm
.
reset
()
;
SvMemoryStream
aDstStm
(
65535
,
65535
);
...
...
@@ -2017,22 +2017,21 @@ bool TransferableDataHelper::GetINetBookmark( const ::com::sun::star::datatransf
if
(
(
aDesc
.
getLength
()
>
4
)
&&
aDesc
.
copy
(
aDesc
.
getLength
()
-
4
).
equalsIgnoreAsciiCase
(
".URL"
)
)
{
SvStream
*
pStream
=
::
utl
::
UcbStreamHelper
::
CreateStream
(
INetURLObject
(
OStringToOUString
(
aDesc
,
eTextEncoding
)
).
GetMainURL
(
INetURLObject
::
NO_DECODE
),
STREAM_STD_READ
);
boost
::
scoped_ptr
<
SvStream
>
pStream
(
::
utl
::
UcbStreamHelper
::
CreateStream
(
INetURLObject
(
OStringToOUString
(
aDesc
,
eTextEncoding
)
).
GetMainURL
(
INetURLObject
::
NO_DECODE
),
STREAM_STD_READ
)
)
;
if
(
!
pStream
||
pStream
->
GetError
()
)
{
DataFlavor
aFileContentFlavor
;
aSeq
.
realloc
(
0
);
delete
pStream
;
pStream
=
NULL
;
pStream
.
reset
();
if
(
SotExchange
::
GetFormatDataFlavor
(
SOT_FORMATSTR_ID_FILECONTENT
,
aFileContentFlavor
))
{
aSeq
=
GetSequence
(
aFileContentFlavor
,
OUString
());
if
(
aSeq
.
getLength
())
pStream
=
new
SvMemoryStream
(
(
sal_Char
*
)
aSeq
.
getConstArray
(),
aSeq
.
getLength
(),
STREAM_STD_READ
);
pStream
.
reset
(
new
SvMemoryStream
(
(
sal_Char
*
)
aSeq
.
getConstArray
(),
aSeq
.
getLength
(),
STREAM_STD_READ
)
);
}
}
...
...
@@ -2053,8 +2052,6 @@ bool TransferableDataHelper::GetINetBookmark( const ::com::sun::star::datatransf
break
;
}
}
delete
pStream
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment