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
f339cd61
Kaydet (Commit)
f339cd61
authored
Kas 25, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#1340229 try and silence Resource leak
Change-Id: I5babf6365c50b7c5ad58cdb74729b9a8ac1c4ebc
üst
3c100a9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
docsh2.cxx
sw/source/uibase/app/docsh2.cxx
+9
-12
No files found.
sw/source/uibase/app/docsh2.cxx
Dosyayı görüntüle @
f339cd61
...
@@ -1534,13 +1534,13 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
...
@@ -1534,13 +1534,13 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
}
}
// 2. Open the file ourselves
// 2. Open the file ourselves
SfxMedium
*
pMed
=
new
SfxMedium
(
aTmpObj
.
GetMainURL
(
std
::
unique_ptr
<
SfxMedium
>
xMed
(
new
SfxMedium
(
aTmpObj
.
GetMainURL
(
INetURLObject
::
NO_DECODE
),
StreamMode
::
READ
);
INetURLObject
::
NO_DECODE
),
StreamMode
::
READ
)
)
;
if
(
INetProtocol
::
File
==
aTmpObj
.
GetProtocol
()
)
if
(
INetProtocol
::
File
==
aTmpObj
.
GetProtocol
()
)
p
Med
->
Download
();
// Touch the medium (download it)
x
Med
->
Download
();
// Touch the medium (download it)
const
SfxFilter
*
pSfxFlt
=
nullptr
;
const
SfxFilter
*
pSfxFlt
=
nullptr
;
if
(
!
pMed
->
GetError
()
)
if
(
!
xMed
->
GetError
()
)
{
{
SfxFilterMatcher
aMatcher
(
OUString
::
createFromAscii
(
SwDocShell
::
Factory
().
GetShortName
())
);
SfxFilterMatcher
aMatcher
(
OUString
::
createFromAscii
(
SwDocShell
::
Factory
().
GetShortName
())
);
...
@@ -1551,24 +1551,24 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
...
@@ -1551,24 +1551,24 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
}
}
if
(
nVersion
)
if
(
nVersion
)
p
Med
->
GetItemSet
()
->
Put
(
SfxInt16Item
(
SID_VERSION
,
nVersion
));
x
Med
->
GetItemSet
()
->
Put
(
SfxInt16Item
(
SID_VERSION
,
nVersion
));
if
(
!
rPasswd
.
isEmpty
()
)
if
(
!
rPasswd
.
isEmpty
()
)
p
Med
->
GetItemSet
()
->
Put
(
SfxStringItem
(
SID_PASSWORD
,
rPasswd
));
x
Med
->
GetItemSet
()
->
Put
(
SfxStringItem
(
SID_PASSWORD
,
rPasswd
));
if
(
!
pSfxFlt
)
if
(
!
pSfxFlt
)
aMatcher
.
DetectFilter
(
*
p
Med
,
&
pSfxFlt
,
false
);
aMatcher
.
DetectFilter
(
*
x
Med
,
&
pSfxFlt
,
false
);
if
(
pSfxFlt
)
if
(
pSfxFlt
)
{
{
// We cannot do anything without a Filter
// We cannot do anything without a Filter
p
Med
->
SetFilter
(
pSfxFlt
);
x
Med
->
SetFilter
(
pSfxFlt
);
// If the new shell is created, SfxObjectShellLock should be used to let it be closed later for sure
// If the new shell is created, SfxObjectShellLock should be used to let it be closed later for sure
SwDocShell
*
const
pNew
(
new
SwDocShell
(
SfxObjectCreateMode
::
INTERNAL
));
SwDocShell
*
const
pNew
(
new
SwDocShell
(
SfxObjectCreateMode
::
INTERNAL
));
xLockRef
=
pNew
;
xLockRef
=
pNew
;
xDocSh
=
static_cast
<
SfxObjectShell
*>
(
xLockRef
);
xDocSh
=
static_cast
<
SfxObjectShell
*>
(
xLockRef
);
if
(
xDocSh
->
DoLoad
(
pMed
)
)
if
(
xDocSh
->
DoLoad
(
xMed
.
release
())
)
{
{
SwDoc
const
&
rDoc
(
*
pNew
->
GetDoc
());
SwDoc
const
&
rDoc
(
*
pNew
->
GetDoc
());
const_cast
<
SwDoc
&>
(
rDoc
).
GetNodes
().
ForEach
(
&
lcl_MergePortions
);
const_cast
<
SwDoc
&>
(
rDoc
).
GetNodes
().
ForEach
(
&
lcl_MergePortions
);
...
@@ -1577,9 +1577,6 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
...
@@ -1577,9 +1577,6 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
}
}
}
}
if
(
!
xDocSh
.
Is
()
)
// Medium still needs to be deleted
delete
pMed
;
return
0
;
return
0
;
}
}
...
...
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