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
b409cdef
Kaydet (Commit)
b409cdef
authored
Haz 03, 2011
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed dependency of ScCollection and ScDataObject.
üst
6bae4674
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
46 deletions
+46
-46
areasave.hxx
sc/source/ui/inc/areasave.hxx
+14
-12
areasave.cxx
sc/source/ui/undo/areasave.cxx
+32
-34
No files found.
sc/source/ui/inc/areasave.hxx
Dosyayı görüntüle @
b409cdef
...
...
@@ -29,15 +29,15 @@
#ifndef SC_AREASAVE_HXX
#define SC_AREASAVE_HXX
#include "collect.hxx"
#include "global.hxx"
#include "address.hxx"
#include <boost/ptr_container/ptr_vector.hpp>
class
ScDocument
;
class
ScAreaLink
;
class
ScAreaLinkSaver
:
public
ScDataObject
class
ScAreaLinkSaver
{
private
:
::
rtl
::
OUString
aFileName
;
...
...
@@ -50,9 +50,7 @@ private:
public
:
ScAreaLinkSaver
(
const
ScAreaLink
&
rSource
);
ScAreaLinkSaver
(
const
ScAreaLinkSaver
&
rCopy
);
virtual
~
ScAreaLinkSaver
();
virtual
ScDataObject
*
Clone
()
const
;
~
ScAreaLinkSaver
();
bool
IsEqual
(
const
ScAreaLink
&
rCompare
)
const
;
bool
IsEqualSource
(
const
ScAreaLink
&
rCompare
)
const
;
...
...
@@ -62,22 +60,26 @@ public:
};
class
ScAreaLinkSaveCollection
:
public
ScCollection
class
ScAreaLinkSaveCollection
{
typedef
::
boost
::
ptr_vector
<
ScAreaLinkSaver
>
DataType
;
DataType
maData
;
public
:
ScAreaLinkSaveCollection
();
ScAreaLinkSaveCollection
(
const
ScAreaLinkSaveCollection
&
rCopy
);
virtual
~
ScAreaLinkSaveCollection
();
ScAreaLinkSaveCollection
(
const
ScAreaLinkSaveCollection
&
r
);
~
ScAreaLinkSaveCollection
();
virtual
ScDataObject
*
Clone
()
const
;
ScAreaLinkSaver
*
operator
[](
sal_uInt16
nIndex
)
const
{
return
(
ScAreaLinkSaver
*
)
At
(
nIndex
);}
bool
IsEqual
(
const
ScDocument
*
pDoc
)
const
;
void
Restore
(
ScDocument
*
pDoc
)
const
;
// returns NULL if empty
static
ScAreaLinkSaveCollection
*
CreateFromDoc
(
const
ScDocument
*
pDoc
);
const
ScAreaLinkSaver
*
operator
[](
size_t
nIndex
)
const
;
size_t
size
()
const
;
void
clear
();
void
push_back
(
ScAreaLinkSaver
*
p
);
};
...
...
sc/source/ui/undo/areasave.cxx
Dosyayı görüntüle @
b409cdef
...
...
@@ -54,7 +54,6 @@ ScAreaLinkSaver::ScAreaLinkSaver( const ScAreaLink& rSource ) :
}
ScAreaLinkSaver
::
ScAreaLinkSaver
(
const
ScAreaLinkSaver
&
rCopy
)
:
ScDataObject
(),
aFileName
(
rCopy
.
aFileName
),
aFilterName
(
rCopy
.
aFilterName
),
aOptions
(
rCopy
.
aOptions
),
...
...
@@ -64,14 +63,7 @@ ScAreaLinkSaver::ScAreaLinkSaver( const ScAreaLinkSaver& rCopy ) :
{
}
ScAreaLinkSaver
::~
ScAreaLinkSaver
()
{
}
ScDataObject
*
ScAreaLinkSaver
::
Clone
()
const
{
return
new
ScAreaLinkSaver
(
*
this
);
}
ScAreaLinkSaver
::~
ScAreaLinkSaver
()
{}
bool
ScAreaLinkSaver
::
IsEqualSource
(
const
ScAreaLink
&
rCompare
)
const
{
...
...
@@ -113,25 +105,12 @@ void ScAreaLinkSaver::InsertNewLink( ScDocument* pDoc ) const
}
}
// -----------------------------------------------------------------------
ScAreaLinkSaveCollection
::
ScAreaLinkSaveCollection
()
{
}
ScAreaLinkSaveCollection
::
ScAreaLinkSaveCollection
(
const
ScAreaLinkSaveCollection
&
rCopy
)
:
ScCollection
(
rCopy
)
{
}
ScAreaLinkSaveCollection
::
ScAreaLinkSaveCollection
()
{}
ScAreaLinkSaveCollection
::~
ScAreaLinkSaveCollection
()
{
}
ScAreaLinkSaveCollection
::
ScAreaLinkSaveCollection
(
const
ScAreaLinkSaveCollection
&
r
)
:
maData
(
r
.
maData
)
{}
ScDataObject
*
ScAreaLinkSaveCollection
::
Clone
()
const
{
return
new
ScAreaLinkSaveCollection
(
*
this
);
}
ScAreaLinkSaveCollection
::~
ScAreaLinkSaveCollection
()
{}
bool
ScAreaLinkSaveCollection
::
IsEqual
(
const
ScDocument
*
pDoc
)
const
{
...
...
@@ -141,7 +120,7 @@ bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const
sfx2
::
LinkManager
*
pLinkManager
=
const_cast
<
ScDocument
*>
(
pDoc
)
->
GetLinkManager
();
if
(
pLinkManager
)
{
s
al_uInt16
nPos
=
0
;
s
ize_t
nPos
=
0
;
const
::
sfx2
::
SvBaseLinks
&
rLinks
=
pLinkManager
->
GetLinks
();
sal_uInt16
nLinkCount
=
rLinks
.
Count
();
for
(
sal_uInt16
i
=
0
;
i
<
nLinkCount
;
i
++
)
...
...
@@ -149,13 +128,13 @@ bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const
::
sfx2
::
SvBaseLink
*
pBase
=
*
rLinks
[
i
];
if
(
pBase
->
ISA
(
ScAreaLink
))
{
if
(
nPos
>=
GetCount
()
||
!
(
*
this
)[
nPos
]
->
IsEqual
(
*
(
ScAreaLink
*
)
pBase
)
)
if
(
nPos
>=
size
()
||
!
(
*
this
)[
nPos
]
->
IsEqual
(
*
(
ScAreaLink
*
)
pBase
)
)
return
false
;
++
nPos
;
}
}
if
(
nPos
<
GetCount
()
)
if
(
nPos
<
size
()
)
return
false
;
// fewer links in the document than in the save collection
}
...
...
@@ -188,10 +167,10 @@ void ScAreaLinkSaveCollection::Restore( ScDocument* pDoc ) const
if
(
pLinkManager
)
{
const
::
sfx2
::
SvBaseLinks
&
rLinks
=
pLinkManager
->
GetLinks
();
s
al_uInt16
nSaveCount
=
GetCount
();
for
(
s
al_uInt16
nPos
=
0
;
nPos
<
nSaveCount
;
nPos
++
)
s
ize_t
nSaveCount
=
size
();
for
(
s
ize_t
nPos
=
0
;
nPos
<
nSaveCount
;
++
nPos
)
{
ScAreaLinkSaver
*
pSaver
=
(
*
this
)[
nPos
];
const
ScAreaLinkSaver
*
pSaver
=
(
*
this
)[
nPos
];
ScAreaLink
*
pLink
=
lcl_FindLink
(
rLinks
,
*
pSaver
);
if
(
pLink
)
pSaver
->
WriteToLink
(
*
pLink
);
// restore output position
...
...
@@ -219,8 +198,7 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum
pColl
=
new
ScAreaLinkSaveCollection
;
ScAreaLinkSaver
*
pSaver
=
new
ScAreaLinkSaver
(
*
(
ScAreaLink
*
)
pBase
);
if
(
!
pColl
->
Insert
(
pSaver
))
delete
pSaver
;
pColl
->
push_back
(
pSaver
);
}
}
}
...
...
@@ -228,4 +206,24 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum
return
pColl
;
}
const
ScAreaLinkSaver
*
ScAreaLinkSaveCollection
::
operator
[](
size_t
nIndex
)
const
{
return
&
maData
[
nIndex
];
}
size_t
ScAreaLinkSaveCollection
::
size
()
const
{
return
maData
.
size
();
}
void
ScAreaLinkSaveCollection
::
clear
()
{
maData
.
clear
();
}
void
ScAreaLinkSaveCollection
::
push_back
(
ScAreaLinkSaver
*
p
)
{
maData
.
push_back
(
p
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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