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
bc3b3d1d
Kaydet (Commit)
bc3b3d1d
authored
Nis 24, 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: I03096fe1da8a111312f9384b94cfcb2ead7b3d38
üst
ec544e53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
24 deletions
+17
-24
attarray.cxx
sc/source/core/data/attarray.cxx
+12
-15
column.cxx
sc/source/core/data/column.cxx
+5
-9
No files found.
sc/source/core/data/attarray.cxx
Dosyayı görüntüle @
bc3b3d1d
...
...
@@ -45,6 +45,7 @@
#include "cellvalue.hxx"
#include "editutil.hxx"
#include <rtl/strbuf.hxx>
#include <boost/scoped_ptr.hpp>
// STATIC DATA -----------------------------------------------------------
...
...
@@ -586,7 +587,7 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
do
{
const
ScPatternAttr
*
pOldPattern
=
pData
[
nPos
].
pPattern
;
ScPatternAttr
*
pNewPattern
=
new
ScPatternAttr
(
*
pOldPattern
);
boost
::
scoped_ptr
<
ScPatternAttr
>
pNewPattern
(
new
ScPatternAttr
(
*
pOldPattern
)
);
pNewPattern
->
SetStyleSheet
(
pStyle
);
SCROW
nY1
=
nStart
;
SCROW
nY2
=
pData
[
nPos
].
nRow
;
...
...
@@ -602,7 +603,7 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
{
if
(
nY1
<
nStartRow
)
nY1
=
nStartRow
;
if
(
nY2
>
nEndRow
)
nY2
=
nEndRow
;
SetPatternArea
(
nY1
,
nY2
,
pNewPattern
,
true
);
SetPatternArea
(
nY1
,
nY2
,
pNewPattern
.
get
()
,
true
);
Search
(
nStart
,
nPos
);
}
else
...
...
@@ -629,7 +630,6 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
else
nPos
++
;
}
delete
pNewPattern
;
}
while
((
nStart
<=
nEndRow
)
&&
(
nPos
<
nCount
));
...
...
@@ -687,7 +687,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
if
(
(
SFX_ITEM_SET
==
eState
)
||
(
SFX_ITEM_SET
==
eTLBRState
)
||
(
SFX_ITEM_SET
==
eBLTRState
)
)
{
ScPatternAttr
*
pNewPattern
=
new
ScPatternAttr
(
*
pOldPattern
);
boost
::
scoped_ptr
<
ScPatternAttr
>
pNewPattern
(
new
ScPatternAttr
(
*
pOldPattern
)
);
SfxItemSet
&
rNewSet
=
pNewPattern
->
GetItemSet
();
SCROW
nY1
=
nStart
;
SCROW
nY2
=
pData
[
nPos
].
nRow
;
...
...
@@ -754,7 +754,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
{
if
(
nY1
<
nStartRow
)
nY1
=
nStartRow
;
if
(
nY2
>
nEndRow
)
nY2
=
nEndRow
;
SetPatternArea
(
nY1
,
nY2
,
pNewPattern
,
true
);
SetPatternArea
(
nY1
,
nY2
,
pNewPattern
.
get
()
,
true
);
Search
(
nStart
,
nPos
);
}
else
...
...
@@ -772,7 +772,6 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
delete
pNewBoxItem
;
delete
pNewTLBRItem
;
delete
pNewBLTRItem
;
delete
pNewPattern
;
}
else
{
...
...
@@ -1467,12 +1466,12 @@ bool ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
for
(
SCROW
nThisRow
=
nThisStart
;
nThisRow
<=
nThisEnd
;
nThisRow
++
)
pDocument
->
ApplyAttr
(
nThisCol
,
nThisRow
,
nTab
,
*
pAttr
);
ScPatternAttr
*
pNewPattern
=
new
ScPatternAttr
(
pDocument
->
GetPool
()
);
boost
::
scoped_ptr
<
ScPatternAttr
>
pNewPattern
(
new
ScPatternAttr
(
pDocument
->
GetPool
()
)
);
SfxItemSet
*
pSet
=
&
pNewPattern
->
GetItemSet
();
pSet
->
Put
(
*
pFlagAttr
);
pDocument
->
ApplyPatternAreaTab
(
nThisCol
,
nThisStart
,
nMergeEndCol
,
nMergeEndRow
,
nTab
,
*
pNewPattern
);
delete
pNewPattern
;
pNewPattern
.
reset
()
;
Search
(
nThisEnd
,
nIndex
);
// data changed
}
...
...
@@ -1524,11 +1523,10 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow,
// because it would have no cell style information.
// Instead, the document's GetDefPattern is copied. Since it is passed as
// pWantedPattern, no special treatment of default is needed here anymore.
ScPatternAttr
*
pNewPattern
=
new
ScPatternAttr
(
*
pWantedPattern
);
boost
::
scoped_ptr
<
ScPatternAttr
>
pNewPattern
(
new
ScPatternAttr
(
*
pWantedPattern
)
);
SfxItemSet
*
pSet
=
&
pNewPattern
->
GetItemSet
();
pSet
->
Put
(
*
pItem
);
SetPatternArea
(
nThisRow
,
nAttrRow
,
pNewPattern
,
true
);
delete
pNewPattern
;
SetPatternArea
(
nThisRow
,
nAttrRow
,
pNewPattern
.
get
(),
true
);
}
else
{
...
...
@@ -1762,7 +1760,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBo
if
(
bReset
)
{
ScPatternAttr
*
pNewPattern
=
new
ScPatternAttr
(
*
pData
[
nPos
].
pPattern
);
boost
::
scoped_ptr
<
ScPatternAttr
>
pNewPattern
(
new
ScPatternAttr
(
*
pData
[
nPos
].
pPattern
)
);
pDocument
->
GetPool
()
->
Remove
(
*
pData
[
nPos
].
pPattern
);
pNewPattern
->
SetStyleSheet
(
(
ScStyleSheet
*
)
pDocument
->
GetStyleSheetPool
()
->
...
...
@@ -1771,7 +1769,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBo
SFXSTYLEBIT_AUTO
|
SCSTYLEBIT_STANDARD
)
);
pData
[
nPos
].
pPattern
=
(
const
ScPatternAttr
*
)
&
pDocument
->
GetPool
()
->
Put
(
*
pNewPattern
);
delete
pNewPattern
;
pNewPattern
.
reset
()
;
if
(
Concat
(
nPos
))
{
...
...
@@ -2273,7 +2271,7 @@ void ScAttrArray::CopyArea(
}
else
if
(
nStripFlags
)
{
ScPatternAttr
*
pTmpPattern
=
new
ScPatternAttr
(
*
pOldPattern
);
boost
::
scoped_ptr
<
ScPatternAttr
>
pTmpPattern
(
new
ScPatternAttr
(
*
pOldPattern
)
);
sal_Int16
nNewFlags
=
0
;
if
(
nStripFlags
!=
SC_MF_ALL
)
nNewFlags
=
((
const
ScMergeFlagAttr
&
)
pTmpPattern
->
GetItem
(
ATTR_MERGE_FLAG
)).
...
...
@@ -2288,7 +2286,6 @@ void ScAttrArray::CopyArea(
pNewPattern
=
(
ScPatternAttr
*
)
&
pDestDocPool
->
Put
(
*
pTmpPattern
);
else
pNewPattern
=
pTmpPattern
->
PutInPool
(
rAttrArray
.
pDocument
,
pDocument
);
delete
pTmpPattern
;
}
else
{
...
...
sc/source/core/data/column.cxx
Dosyayı görüntüle @
bc3b3d1d
...
...
@@ -574,12 +574,11 @@ void ScColumn::RemoveCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nInd
void
ScColumn
::
ApplyStyle
(
SCROW
nRow
,
const
ScStyleSheet
&
rStyle
)
{
const
ScPatternAttr
*
pPattern
=
pAttrArray
->
GetPattern
(
nRow
);
ScPatternAttr
*
pNewPattern
=
new
ScPatternAttr
(
*
pPattern
);
boost
::
scoped_ptr
<
ScPatternAttr
>
pNewPattern
(
new
ScPatternAttr
(
*
pPattern
)
);
if
(
pNewPattern
)
{
pNewPattern
->
SetStyleSheet
((
ScStyleSheet
*
)
&
rStyle
);
pAttrArray
->
SetPattern
(
nRow
,
pNewPattern
,
true
);
delete
pNewPattern
;
pAttrArray
->
SetPattern
(
nRow
,
pNewPattern
.
get
(),
true
);
}
}
...
...
@@ -740,7 +739,7 @@ void ScColumn::ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr )
ScDocumentPool
*
pDocPool
=
pDocument
->
GetPool
();
const
ScPatternAttr
*
pOldPattern
=
pAttrArray
->
GetPattern
(
nRow
);
ScPatternAttr
*
pTemp
=
new
ScPatternAttr
(
*
pOldPattern
);
boost
::
scoped_ptr
<
ScPatternAttr
>
pTemp
(
new
ScPatternAttr
(
*
pOldPattern
)
);
pTemp
->
GetItemSet
().
Put
(
rAttr
);
const
ScPatternAttr
*
pNewPattern
=
(
const
ScPatternAttr
*
)
&
pDocPool
->
Put
(
*
pTemp
);
...
...
@@ -748,8 +747,6 @@ void ScColumn::ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr )
pAttrArray
->
SetPattern
(
nRow
,
pNewPattern
);
else
pDocPool
->
Remove
(
*
pNewPattern
);
// free up resources
delete
pTemp
;
}
ScDocument
&
ScColumn
::
GetDoc
()
...
...
@@ -1708,10 +1705,9 @@ void ScColumn::CopyToColumn(
const
ScStyleSheet
*
pStyle
=
rColumn
.
pAttrArray
->
GetPattern
(
nRow
)
->
GetStyleSheet
();
const
ScPatternAttr
*
pPattern
=
pAttrArray
->
GetPattern
(
nRow
);
ScPatternAttr
*
pNewPattern
=
new
ScPatternAttr
(
*
pPattern
);
boost
::
scoped_ptr
<
ScPatternAttr
>
pNewPattern
(
new
ScPatternAttr
(
*
pPattern
)
);
pNewPattern
->
SetStyleSheet
(
(
ScStyleSheet
*
)
pStyle
);
rColumn
.
pAttrArray
->
SetPattern
(
nRow
,
pNewPattern
,
true
);
delete
pNewPattern
;
rColumn
.
pAttrArray
->
SetPattern
(
nRow
,
pNewPattern
.
get
(),
true
);
}
}
else
...
...
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