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
f3816179
Kaydet (Commit)
f3816179
authored
May 02, 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: Id1c7cb886a892bf0ce7be6774be5408afad44432
üst
e23c98d7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
51 deletions
+47
-51
xestream.cxx
sc/source/filter/excel/xestream.cxx
+5
-5
xistream.cxx
sc/source/filter/excel/xistream.cxx
+11
-14
lotform.cxx
sc/source/filter/lotus/lotform.cxx
+4
-5
docsh6.cxx
sc/source/ui/docshell/docsh6.cxx
+2
-3
CellBorderStyleControl.cxx
sc/source/ui/sidebar/CellBorderStyleControl.cxx
+13
-12
undoblk.cxx
sc/source/ui/undo/undoblk.cxx
+5
-4
undotab.cxx
sc/source/ui/undo/undotab.cxx
+7
-8
No files found.
sc/source/filter/excel/xestream.cxx
Dosyayı görüntüle @
f3816179
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
#include <sfx2/app.hxx>
#include <sfx2/app.hxx>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <boost/scoped_array.hpp>
#define DEBUG_XL_ENCRYPTION 0
#define DEBUG_XL_ENCRYPTION 0
...
@@ -284,19 +285,18 @@ void XclExpStream::CopyFromStream(SvStream& rInStrm, sal_uInt64 const nBytes)
...
@@ -284,19 +285,18 @@ void XclExpStream::CopyFromStream(SvStream& rInStrm, sal_uInt64 const nBytes)
if
(
nBytesLeft
>
0
)
if
(
nBytesLeft
>
0
)
{
{
const
sal_Size
nMaxBuffer
=
4096
;
const
sal_Size
nMaxBuffer
=
4096
;
sal_uInt8
*
const
pBuffer
=
boost
::
scoped_array
<
sal_uInt8
>
pBuffer
(
new
sal_uInt8
[
::
std
::
min
<
sal_Size
>
(
nBytesLeft
,
nMaxBuffer
)
];
new
sal_uInt8
[
::
std
::
min
<
sal_Size
>
(
nBytesLeft
,
nMaxBuffer
)
]
)
;
bool
bValid
=
true
;
bool
bValid
=
true
;
while
(
bValid
&&
(
nBytesLeft
>
0
)
)
while
(
bValid
&&
(
nBytesLeft
>
0
)
)
{
{
sal_Size
nWriteLen
=
::
std
::
min
<
sal_Size
>
(
nBytesLeft
,
nMaxBuffer
);
sal_Size
nWriteLen
=
::
std
::
min
<
sal_Size
>
(
nBytesLeft
,
nMaxBuffer
);
rInStrm
.
Read
(
pBuffer
,
nWriteLen
);
rInStrm
.
Read
(
pBuffer
.
get
()
,
nWriteLen
);
sal_Size
nWriteRet
=
Write
(
pBuffer
,
nWriteLen
);
sal_Size
nWriteRet
=
Write
(
pBuffer
.
get
()
,
nWriteLen
);
bValid
=
(
nWriteLen
==
nWriteRet
);
bValid
=
(
nWriteLen
==
nWriteRet
);
nBytesLeft
-=
nWriteRet
;
nBytesLeft
-=
nWriteRet
;
}
}
delete
[]
pBuffer
;
}
}
}
}
...
...
sc/source/filter/excel/xistream.cxx
Dosyayı görüntüle @
f3816179
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include "xiroot.hxx"
#include "xiroot.hxx"
#include <vector>
#include <vector>
#include <boost/scoped_array.hpp>
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
;
...
@@ -790,20 +791,18 @@ sal_Size XclImpStream::CopyToStream( SvStream& rOutStrm, sal_Size nBytes )
...
@@ -790,20 +791,18 @@ sal_Size XclImpStream::CopyToStream( SvStream& rOutStrm, sal_Size nBytes )
if
(
mbValid
&&
(
nBytes
>
0
)
)
if
(
mbValid
&&
(
nBytes
>
0
)
)
{
{
const
sal_Size
nMaxBuffer
=
4096
;
const
sal_Size
nMaxBuffer
=
4096
;
sal_uInt8
*
pnBuffer
=
new
sal_uInt8
[
::
std
::
min
(
nBytes
,
nMaxBuffer
)
]
;
boost
::
scoped_array
<
sal_uInt8
>
pnBuffer
(
new
sal_uInt8
[
::
std
::
min
(
nBytes
,
nMaxBuffer
)
])
;
sal_Size
nBytesLeft
=
nBytes
;
sal_Size
nBytesLeft
=
nBytes
;
while
(
mbValid
&&
(
nBytesLeft
>
0
)
)
while
(
mbValid
&&
(
nBytesLeft
>
0
)
)
{
{
sal_Size
nReadSize
=
::
std
::
min
(
nBytesLeft
,
nMaxBuffer
);
sal_Size
nReadSize
=
::
std
::
min
(
nBytesLeft
,
nMaxBuffer
);
nRet
+=
Read
(
pnBuffer
,
nReadSize
);
nRet
+=
Read
(
pnBuffer
.
get
()
,
nReadSize
);
// writing more bytes than read results in invalid memory access
// writing more bytes than read results in invalid memory access
SAL_WARN_IF
(
nRet
!=
nReadSize
,
"sc"
,
"read less bytes than requested"
);
SAL_WARN_IF
(
nRet
!=
nReadSize
,
"sc"
,
"read less bytes than requested"
);
rOutStrm
.
Write
(
pnBuffer
,
nReadSize
);
rOutStrm
.
Write
(
pnBuffer
.
get
()
,
nReadSize
);
nBytesLeft
-=
nReadSize
;
nBytesLeft
-=
nReadSize
;
}
}
delete
[]
pnBuffer
;
}
}
return
nRet
;
return
nRet
;
}
}
...
@@ -881,7 +880,7 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit )
...
@@ -881,7 +880,7 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit )
sal_uInt16
nCharsLeft
=
nChars
;
sal_uInt16
nCharsLeft
=
nChars
;
sal_uInt16
nReadSize
;
sal_uInt16
nReadSize
;
sal_Unicode
*
pcBuffer
=
new
sal_Unicode
[
nCharsLeft
+
1
]
;
boost
::
scoped_array
<
sal_Unicode
>
pcBuffer
(
new
sal_Unicode
[
nCharsLeft
+
1
])
;
while
(
IsValid
()
&&
(
nCharsLeft
>
0
)
)
while
(
IsValid
()
&&
(
nCharsLeft
>
0
)
)
{
{
...
@@ -894,8 +893,8 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit )
...
@@ -894,8 +893,8 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit )
else
else
nReadSize
=
GetMaxRawReadSize
(
nCharsLeft
);
nReadSize
=
GetMaxRawReadSize
(
nCharsLeft
);
sal_Unicode
*
pcUniChar
=
pcBuffer
;
sal_Unicode
*
pcUniChar
=
pcBuffer
.
get
()
;
sal_Unicode
*
pcEndChar
=
pcBuffer
+
nReadSize
;
sal_Unicode
*
pcEndChar
=
pcBuffer
.
get
()
+
nReadSize
;
if
(
b16Bit
)
if
(
b16Bit
)
{
{
...
@@ -917,14 +916,13 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit )
...
@@ -917,14 +916,13 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit )
}
}
*
pcEndChar
=
'\0'
;
*
pcEndChar
=
'\0'
;
aRet
+=
OUString
(
pcBuffer
);
aRet
+=
OUString
(
pcBuffer
.
get
()
);
nCharsLeft
=
nCharsLeft
-
nReadSize
;
nCharsLeft
=
nCharsLeft
-
nReadSize
;
if
(
nCharsLeft
>
0
)
if
(
nCharsLeft
>
0
)
JumpToNextStringContinue
(
b16Bit
);
JumpToNextStringContinue
(
b16Bit
);
}
}
delete
[]
pcBuffer
;
return
aRet
;
return
aRet
;
}
}
...
@@ -988,11 +986,10 @@ void XclImpStream::IgnoreUniString( sal_uInt16 nChars )
...
@@ -988,11 +986,10 @@ void XclImpStream::IgnoreUniString( sal_uInt16 nChars )
OUString
XclImpStream
::
ReadRawByteString
(
sal_uInt16
nChars
)
OUString
XclImpStream
::
ReadRawByteString
(
sal_uInt16
nChars
)
{
{
sal_Char
*
pcBuffer
=
new
sal_Char
[
nChars
+
1
]
;
boost
::
scoped_array
<
sal_Char
>
pcBuffer
(
new
sal_Char
[
nChars
+
1
])
;
sal_uInt16
nCharsRead
=
ReadRawData
(
pcBuffer
,
nChars
);
sal_uInt16
nCharsRead
=
ReadRawData
(
pcBuffer
.
get
()
,
nChars
);
pcBuffer
[
nCharsRead
]
=
'\0'
;
pcBuffer
[
nCharsRead
]
=
'\0'
;
OUString
aRet
(
pcBuffer
,
strlen
(
pcBuffer
),
mrRoot
.
GetTextEncoding
()
);
OUString
aRet
(
pcBuffer
.
get
(),
strlen
(
pcBuffer
.
get
()),
mrRoot
.
GetTextEncoding
()
);
delete
[]
pcBuffer
;
return
aRet
;
return
aRet
;
}
}
...
...
sc/source/filter/lotus/lotform.cxx
Dosyayı görüntüle @
f3816179
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <math.h>
#include <math.h>
#include <comphelper/string.hxx>
#include <comphelper/string.hxx>
#include <boost/scoped_array.hpp>
extern
WKTYP
eTyp
;
extern
WKTYP
eTyp
;
...
@@ -566,15 +567,13 @@ ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest,
...
@@ -566,15 +567,13 @@ ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest,
if
(
nStrLen
)
if
(
nStrLen
)
{
{
sal_Char
*
p
=
new
(
::
std
::
nothrow
)
sal_Char
[
nStrLen
+
1
]
;
boost
::
scoped_array
<
sal_Char
>
p
(
new
(
::
std
::
nothrow
)
sal_Char
[
nStrLen
+
1
])
;
if
(
p
)
if
(
p
)
{
{
aIn
.
Read
(
p
,
nStrLen
);
aIn
.
Read
(
p
.
get
()
,
nStrLen
);
p
[
nStrLen
]
=
0x00
;
p
[
nStrLen
]
=
0x00
;
DoFunc
(
ocNoName
,
nAnz
,
p
);
DoFunc
(
ocNoName
,
nAnz
,
p
.
get
()
);
delete
[]
p
;
}
}
else
else
DoFunc
(
ocNoName
,
nAnz
,
NULL
);
DoFunc
(
ocNoName
,
nAnz
,
NULL
);
...
...
sc/source/ui/docshell/docsh6.cxx
Dosyayı görüntüle @
f3816179
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
#include <boost/scoped_array.hpp>
using
::
com
::
sun
::
star
::
beans
::
XPropertySet
;
using
::
com
::
sun
::
star
::
beans
::
XPropertySet
;
using
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
;
using
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
;
...
@@ -289,7 +290,7 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellS
...
@@ -289,7 +290,7 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellS
if
(
nSourceCount
==
0
)
if
(
nSourceCount
==
0
)
return
;
// no source styles
return
;
// no source styles
ScStylePair
*
pStyles
=
new
ScStylePair
[
nSourceCount
]
;
boost
::
scoped_array
<
ScStylePair
>
pStyles
(
new
ScStylePair
[
nSourceCount
])
;
sal_uInt16
nFound
=
0
;
sal_uInt16
nFound
=
0
;
// first create all new styles
// first create all new styles
...
@@ -333,8 +334,6 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellS
...
@@ -333,8 +334,6 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellS
lcl_AdjustPool
(
GetStyleSheetPool
()
);
// adjust SetItems
lcl_AdjustPool
(
GetStyleSheetPool
()
);
// adjust SetItems
UpdateAllRowHeights
();
UpdateAllRowHeights
();
PostPaint
(
0
,
0
,
0
,
MAXCOL
,
MAXROW
,
MAXTAB
,
PAINT_GRID
|
PAINT_LEFT
);
// Paint
PostPaint
(
0
,
0
,
0
,
MAXCOL
,
MAXROW
,
MAXTAB
,
PAINT_GRID
|
PAINT_LEFT
);
// Paint
delete
[]
pStyles
;
}
}
...
...
sc/source/ui/sidebar/CellBorderStyleControl.cxx
Dosyayı görüntüle @
f3816179
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <vcl/svapp.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/settings.hxx>
#include <editeng/lineitem.hxx>
#include <editeng/lineitem.hxx>
#include <boost/scoped_ptr.hpp>
namespace
sc
{
namespace
sidebar
{
namespace
sc
{
namespace
sidebar
{
...
@@ -284,8 +285,8 @@ IMPL_LINK(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox)
...
@@ -284,8 +285,8 @@ IMPL_LINK(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox)
SvxBoxItem
aBorderOuter
(
SID_ATTR_BORDER_OUTER
);
SvxBoxItem
aBorderOuter
(
SID_ATTR_BORDER_OUTER
);
SvxBoxInfoItem
aBorderInner
(
SID_ATTR_BORDER_INNER
);
SvxBoxInfoItem
aBorderInner
(
SID_ATTR_BORDER_INNER
);
editeng
::
SvxBorderLine
*
pTop
=
0
,
boost
::
scoped_ptr
<
editeng
::
SvxBorderLine
>
pTop
;
*
pBottom
=
0
;
boost
::
scoped_ptr
<
editeng
::
SvxBorderLine
>
pBottom
;
sal_uInt8
nValidFlags
=
0
;
sal_uInt8
nValidFlags
=
0
;
using
namespace
::
com
::
sun
::
star
::
table
::
BorderLineStyle
;
using
namespace
::
com
::
sun
::
star
::
table
::
BorderLineStyle
;
...
@@ -294,29 +295,29 @@ IMPL_LINK(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox)
...
@@ -294,29 +295,29 @@ IMPL_LINK(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox)
switch
(
nId
)
switch
(
nId
)
{
{
case
TBI_BORDER3_S1
:
case
TBI_BORDER3_S1
:
pBottom
=
new
editeng
::
SvxBorderLine
(
NULL
,
DEF_LINE_WIDTH_2
);
pBottom
.
reset
(
new
editeng
::
SvxBorderLine
(
NULL
,
DEF_LINE_WIDTH_2
)
);
nValidFlags
|=
FRM_VALID_BOTTOM
;
nValidFlags
|=
FRM_VALID_BOTTOM
;
break
;
break
;
case
TBI_BORDER3_S2
:
case
TBI_BORDER3_S2
:
pBottom
=
new
editeng
::
SvxBorderLine
(
NULL
);
pBottom
.
reset
(
new
editeng
::
SvxBorderLine
(
NULL
)
);
pBottom
->
GuessLinesWidths
(
DOUBLE
,
DEF_LINE_WIDTH_0
,
DEF_LINE_WIDTH_0
,
DEF_LINE_WIDTH_1
);
pBottom
->
GuessLinesWidths
(
DOUBLE
,
DEF_LINE_WIDTH_0
,
DEF_LINE_WIDTH_0
,
DEF_LINE_WIDTH_1
);
nValidFlags
|=
FRM_VALID_BOTTOM
;
nValidFlags
|=
FRM_VALID_BOTTOM
;
break
;
break
;
case
TBI_BORDER3_S3
:
case
TBI_BORDER3_S3
:
pBottom
=
new
editeng
::
SvxBorderLine
(
NULL
,
DEF_LINE_WIDTH_2
);
pBottom
.
reset
(
new
editeng
::
SvxBorderLine
(
NULL
,
DEF_LINE_WIDTH_2
)
);
pTop
=
new
editeng
::
SvxBorderLine
(
NULL
,
1
);
pTop
.
reset
(
new
editeng
::
SvxBorderLine
(
NULL
,
1
)
);
nValidFlags
|=
FRM_VALID_BOTTOM
|
FRM_VALID_TOP
;
nValidFlags
|=
FRM_VALID_BOTTOM
|
FRM_VALID_TOP
;
break
;
break
;
case
TBI_BORDER3_S4
:
case
TBI_BORDER3_S4
:
pBottom
=
new
editeng
::
SvxBorderLine
(
NULL
);
pBottom
.
reset
(
new
editeng
::
SvxBorderLine
(
NULL
)
);
pBottom
->
GuessLinesWidths
(
DOUBLE
,
DEF_LINE_WIDTH_0
,
DEF_LINE_WIDTH_0
,
DEF_LINE_WIDTH_1
);
pBottom
->
GuessLinesWidths
(
DOUBLE
,
DEF_LINE_WIDTH_0
,
DEF_LINE_WIDTH_0
,
DEF_LINE_WIDTH_1
);
pTop
=
new
editeng
::
SvxBorderLine
(
NULL
,
1
);
pTop
.
reset
(
new
editeng
::
SvxBorderLine
(
NULL
,
1
)
);
nValidFlags
|=
FRM_VALID_BOTTOM
|
FRM_VALID_TOP
;
nValidFlags
|=
FRM_VALID_BOTTOM
|
FRM_VALID_TOP
;
break
;
break
;
}
}
aBorderOuter
.
SetLine
(
pTop
,
BOX_LINE_TOP
);
aBorderOuter
.
SetLine
(
pTop
.
get
()
,
BOX_LINE_TOP
);
aBorderOuter
.
SetLine
(
pBottom
,
BOX_LINE_BOTTOM
);
aBorderOuter
.
SetLine
(
pBottom
.
get
()
,
BOX_LINE_BOTTOM
);
aBorderOuter
.
SetLine
(
NULL
,
BOX_LINE_LEFT
);
aBorderOuter
.
SetLine
(
NULL
,
BOX_LINE_LEFT
);
aBorderOuter
.
SetLine
(
NULL
,
BOX_LINE_RIGHT
);
aBorderOuter
.
SetLine
(
NULL
,
BOX_LINE_RIGHT
);
...
@@ -331,8 +332,8 @@ IMPL_LINK(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox)
...
@@ -331,8 +332,8 @@ IMPL_LINK(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox)
mrCellAppearancePropertyPanel
.
GetBindings
()
->
GetDispatcher
()
->
Execute
(
SID_ATTR_BORDER
,
SFX_CALLMODE_RECORD
,
&
aBorderOuter
,
&
aBorderInner
,
0L
);
mrCellAppearancePropertyPanel
.
GetBindings
()
->
GetDispatcher
()
->
Execute
(
SID_ATTR_BORDER
,
SFX_CALLMODE_RECORD
,
&
aBorderOuter
,
&
aBorderInner
,
0L
);
delete
pTop
;
pTop
.
reset
()
;
delete
pBottom
;
pBottom
.
reset
()
;
mrCellAppearancePropertyPanel
.
EndCellBorderStylePopupMode
();
mrCellAppearancePropertyPanel
.
EndCellBorderStylePopupMode
();
return
0
;
return
0
;
...
...
sc/source/ui/undo/undoblk.cxx
Dosyayı görüntüle @
f3816179
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
#include <refhint.hxx>
#include <refhint.hxx>
#include <set>
#include <set>
#include <boost/scoped_ptr.hpp>
// STATIC DATA -----------------------------------------------------------
// STATIC DATA -----------------------------------------------------------
...
@@ -1284,7 +1285,7 @@ void ScUndoDragDrop::Redo()
...
@@ -1284,7 +1285,7 @@ void ScUndoDragDrop::Redo()
BeginRedo
();
BeginRedo
();
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
ScDocument
*
pClipDoc
=
new
ScDocument
(
SCDOCMODE_CLIP
);
boost
::
scoped_ptr
<
ScDocument
>
pClipDoc
(
new
ScDocument
(
SCDOCMODE_CLIP
)
);
EnableDrawAdjust
(
pDoc
,
false
);
//! include in ScBlockUndo?
EnableDrawAdjust
(
pDoc
,
false
);
//! include in ScBlockUndo?
...
@@ -1312,7 +1313,7 @@ void ScUndoDragDrop::Redo()
...
@@ -1312,7 +1313,7 @@ void ScUndoDragDrop::Redo()
// do not clone objects and note captions into clipdoc (see above)
// do not clone objects and note captions into clipdoc (see above)
// but at least copy notes
// but at least copy notes
ScClipParam
aClipParam
(
aSrcRange
,
bCut
);
ScClipParam
aClipParam
(
aSrcRange
,
bCut
);
pDoc
->
CopyToClip
(
aClipParam
,
pClipDoc
,
&
aSourceMark
,
false
,
bKeepScenarioFlags
,
false
,
true
);
pDoc
->
CopyToClip
(
aClipParam
,
pClipDoc
.
get
()
,
&
aSourceMark
,
false
,
bKeepScenarioFlags
,
false
,
true
);
if
(
bCut
)
if
(
bCut
)
{
{
...
@@ -1330,7 +1331,7 @@ void ScUndoDragDrop::Redo()
...
@@ -1330,7 +1331,7 @@ void ScUndoDragDrop::Redo()
bool
bIncludeFiltered
=
bCut
;
bool
bIncludeFiltered
=
bCut
;
// TODO: restore old note captions instead of cloning new captions...
// TODO: restore old note captions instead of cloning new captions...
pDoc
->
CopyFromClip
(
aDestRange
,
aDestMark
,
IDF_ALL
&
~
IDF_OBJECTS
,
NULL
,
pClipDoc
,
true
,
false
,
bIncludeFiltered
);
pDoc
->
CopyFromClip
(
aDestRange
,
aDestMark
,
IDF_ALL
&
~
IDF_OBJECTS
,
NULL
,
pClipDoc
.
get
()
,
true
,
false
,
bIncludeFiltered
);
if
(
bCut
)
if
(
bCut
)
for
(
nTab
=
aSrcRange
.
aStart
.
Tab
();
nTab
<=
aSrcRange
.
aEnd
.
Tab
();
nTab
++
)
for
(
nTab
=
aSrcRange
.
aStart
.
Tab
();
nTab
<=
aSrcRange
.
aEnd
.
Tab
();
nTab
++
)
...
@@ -1353,7 +1354,7 @@ void ScUndoDragDrop::Redo()
...
@@ -1353,7 +1354,7 @@ void ScUndoDragDrop::Redo()
SetChangeTrack
();
SetChangeTrack
();
delete
pClipDoc
;
pClipDoc
.
reset
()
;
ShowTable
(
aDestRange
.
aStart
.
Tab
()
);
ShowTable
(
aDestRange
.
aStart
.
Tab
()
);
RedoSdrUndoAction
(
pDrawUndo
);
//! include in ScBlockUndo?
RedoSdrUndoAction
(
pDrawUndo
);
//! include in ScBlockUndo?
...
...
sc/source/ui/undo/undotab.cxx
Dosyayı görüntüle @
f3816179
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
#include "scresid.hxx"
#include "scresid.hxx"
#include <vector>
#include <vector>
#include <boost/scoped_ptr.hpp>
extern
bool
bDrawIsInUndo
;
// somewhere as member!
extern
bool
bDrawIsInUndo
;
// somewhere as member!
...
@@ -512,8 +513,8 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
...
@@ -512,8 +513,8 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
if
(
bUndo
)
// UnDo
if
(
bUndo
)
// UnDo
{
{
size_t
i
=
mpNewTabs
->
size
();
size_t
i
=
mpNewTabs
->
size
();
ScProgress
*
pProgress
=
new
ScProgress
(
pDocShell
,
ScGlobal
::
GetRscString
(
STR_UNDO_MOVE_TAB
),
boost
::
scoped_ptr
<
ScProgress
>
pProgress
(
new
ScProgress
(
pDocShell
,
ScGlobal
::
GetRscString
(
STR_UNDO_MOVE_TAB
),
i
*
pDoc
->
GetCodeCount
(
));
i
*
pDoc
->
GetCodeCount
()
));
for
(;
i
>
0
;
--
i
)
for
(;
i
>
0
;
--
i
)
{
{
SCTAB
nDestTab
=
(
*
mpNewTabs
)[
i
-
1
];
SCTAB
nDestTab
=
(
*
mpNewTabs
)[
i
-
1
];
...
@@ -521,7 +522,7 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
...
@@ -521,7 +522,7 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
if
(
nDestTab
>
MAXTAB
)
// appended ?
if
(
nDestTab
>
MAXTAB
)
// appended ?
nDestTab
=
pDoc
->
GetTableCount
()
-
1
;
nDestTab
=
pDoc
->
GetTableCount
()
-
1
;
pDoc
->
MoveTab
(
nDestTab
,
nOldTab
,
pProgress
);
pDoc
->
MoveTab
(
nDestTab
,
nOldTab
,
pProgress
.
get
()
);
pViewShell
->
GetViewData
()
->
MoveTab
(
nDestTab
,
nOldTab
);
pViewShell
->
GetViewData
()
->
MoveTab
(
nDestTab
,
nOldTab
);
pViewShell
->
SetTabNo
(
nOldTab
,
true
);
pViewShell
->
SetTabNo
(
nOldTab
,
true
);
if
(
mpOldNames
)
if
(
mpOldNames
)
...
@@ -530,13 +531,12 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
...
@@ -530,13 +531,12 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
pDoc
->
RenameTab
(
nOldTab
,
rOldName
);
pDoc
->
RenameTab
(
nOldTab
,
rOldName
);
}
}
}
}
delete
pProgress
;
}
}
else
else
{
{
size_t
n
=
mpNewTabs
->
size
();
size_t
n
=
mpNewTabs
->
size
();
ScProgress
*
pProgress
=
new
ScProgress
(
pDocShell
,
ScGlobal
::
GetRscString
(
STR_UNDO_MOVE_TAB
),
boost
::
scoped_ptr
<
ScProgress
>
pProgress
(
new
ScProgress
(
pDocShell
,
ScGlobal
::
GetRscString
(
STR_UNDO_MOVE_TAB
),
n
*
pDoc
->
GetCodeCount
(
));
n
*
pDoc
->
GetCodeCount
()
));
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
{
{
SCTAB
nDestTab
=
(
*
mpNewTabs
)[
i
];
SCTAB
nDestTab
=
(
*
mpNewTabs
)[
i
];
...
@@ -545,7 +545,7 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
...
@@ -545,7 +545,7 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
if
(
nDestTab
>
MAXTAB
)
// appended ?
if
(
nDestTab
>
MAXTAB
)
// appended ?
nDestTab
=
pDoc
->
GetTableCount
()
-
1
;
nDestTab
=
pDoc
->
GetTableCount
()
-
1
;
pDoc
->
MoveTab
(
nOldTab
,
nNewTab
,
pProgress
);
pDoc
->
MoveTab
(
nOldTab
,
nNewTab
,
pProgress
.
get
()
);
pViewShell
->
GetViewData
()
->
MoveTab
(
nOldTab
,
nNewTab
);
pViewShell
->
GetViewData
()
->
MoveTab
(
nOldTab
,
nNewTab
);
pViewShell
->
SetTabNo
(
nDestTab
,
true
);
pViewShell
->
SetTabNo
(
nDestTab
,
true
);
if
(
mpNewNames
)
if
(
mpNewNames
)
...
@@ -554,7 +554,6 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
...
@@ -554,7 +554,6 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
pDoc
->
RenameTab
(
nNewTab
,
rNewName
);
pDoc
->
RenameTab
(
nNewTab
,
rNewName
);
}
}
}
}
delete
pProgress
;
}
}
SFX_APP
()
->
Broadcast
(
SfxSimpleHint
(
SC_HINT_TABLES_CHANGED
)
);
// Navigator
SFX_APP
()
->
Broadcast
(
SfxSimpleHint
(
SC_HINT_TABLES_CHANGED
)
);
// Navigator
...
...
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