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
9cee6a45
Kaydet (Commit)
9cee6a45
authored
Mar 20, 2014
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added ScEnhancedProtection to ScTableProtection
Change-Id: Id6a444bd01873e30ea1522aaf3b951f4d5adc261
üst
56dd3c27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
tabprotection.hxx
sc/inc/tabprotection.hxx
+19
-0
tabprotection.cxx
sc/source/core/data/tabprotection.cxx
+43
-0
No files found.
sc/inc/tabprotection.hxx
Dosyayı görüntüle @
9cee6a45
...
...
@@ -24,6 +24,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include "global.hxx"
#include "rangelst.hxx"
#include <boost/shared_ptr.hpp>
class
ScDocument
;
...
...
@@ -110,6 +111,19 @@ private:
::
boost
::
shared_ptr
<
ScTableProtectionImpl
>
mpImpl
;
};
/** Container for the Excel EnhancedProtection feature.
*/
struct
ScEnhancedProtection
{
ScRangeListRef
maRangeList
;
sal_uInt32
mnAreserved
;
sal_uInt32
mnPasswordVerifier
;
OUString
maTitle
;
::
std
::
vector
<
sal_uInt8
>
maSecurityDescriptor
;
// raw data
ScEnhancedProtection
()
:
mnAreserved
(
0
),
mnPasswordVerifier
(
0
)
{}
};
/** sheet protection state container
*
* This class stores sheet's protection state: 1) whether the protection
...
...
@@ -163,6 +177,11 @@ public:
bool
isOptionEnabled
(
Option
eOption
)
const
;
void
setOption
(
Option
eOption
,
bool
bEnabled
);
void
setEnhancedProtection
(
const
::
std
::
vector
<
ScEnhancedProtection
>
&
rProt
);
const
::
std
::
vector
<
ScEnhancedProtection
>
&
getEnhancedProtection
()
const
;
bool
updateReference
(
UpdateRefMode
,
ScDocument
*
,
const
ScRange
&
rWhere
,
SCsCOL
nDx
,
SCsROW
nDy
,
SCsTAB
nDz
);
private
:
::
boost
::
shared_ptr
<
ScTableProtectionImpl
>
mpImpl
;
};
...
...
sc/source/core/data/tabprotection.cxx
Dosyayı görüntüle @
9cee6a45
...
...
@@ -117,6 +117,10 @@ public:
bool
isOptionEnabled
(
SCSIZE
nOptId
)
const
;
void
setOption
(
SCSIZE
nOptId
,
bool
bEnabled
);
void
setEnhancedProtection
(
const
::
std
::
vector
<
ScEnhancedProtection
>
&
rProt
);
const
::
std
::
vector
<
ScEnhancedProtection
>
&
getEnhancedProtection
()
const
;
bool
updateReference
(
UpdateRefMode
,
ScDocument
*
,
const
ScRange
&
rWhere
,
SCsCOL
nDx
,
SCsROW
nDy
,
SCsTAB
nDz
);
private
:
OUString
maPassText
;
::
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>
maPassHash
;
...
...
@@ -125,6 +129,7 @@ private:
bool
mbProtected
;
ScPasswordHash
meHash1
;
ScPasswordHash
meHash2
;
::
std
::
vector
<
ScEnhancedProtection
>
maEnhancedProtection
;
};
Sequence
<
sal_Int8
>
ScTableProtectionImpl
::
hashPassword
(
const
OUString
&
aPassText
,
ScPasswordHash
eHash
)
...
...
@@ -352,6 +357,27 @@ void ScTableProtectionImpl::setOption(SCSIZE nOptId, bool bEnabled)
maOptions
[
nOptId
]
=
bEnabled
;
}
void
ScTableProtectionImpl
::
setEnhancedProtection
(
const
::
std
::
vector
<
ScEnhancedProtection
>
&
rProt
)
{
maEnhancedProtection
=
rProt
;
}
const
::
std
::
vector
<
ScEnhancedProtection
>
&
ScTableProtectionImpl
::
getEnhancedProtection
()
const
{
return
maEnhancedProtection
;
}
bool
ScTableProtectionImpl
::
updateReference
(
UpdateRefMode
eMode
,
ScDocument
*
pDoc
,
const
ScRange
&
rWhere
,
SCsCOL
nDx
,
SCsROW
nDy
,
SCsTAB
nDz
)
{
bool
bChanged
=
false
;
for
(
::
std
::
vector
<
ScEnhancedProtection
>::
iterator
it
(
maEnhancedProtection
.
begin
());
it
!=
maEnhancedProtection
.
end
();
++
it
)
{
bChanged
|=
(
*
it
).
maRangeList
->
UpdateReference
(
eMode
,
pDoc
,
rWhere
,
nDx
,
nDy
,
nDz
);
}
return
bChanged
;
}
ScDocProtection
::
ScDocProtection
()
:
...
...
@@ -505,4 +531,21 @@ void ScTableProtection::setOption(Option eOption, bool bEnabled)
{
mpImpl
->
setOption
(
eOption
,
bEnabled
);
}
void
ScTableProtection
::
setEnhancedProtection
(
const
::
std
::
vector
<
ScEnhancedProtection
>
&
rProt
)
{
mpImpl
->
setEnhancedProtection
(
rProt
);
}
const
::
std
::
vector
<
ScEnhancedProtection
>
&
ScTableProtection
::
getEnhancedProtection
()
const
{
return
mpImpl
->
getEnhancedProtection
();
}
bool
ScTableProtection
::
updateReference
(
UpdateRefMode
eMode
,
ScDocument
*
pDoc
,
const
ScRange
&
rWhere
,
SCsCOL
nDx
,
SCsROW
nDy
,
SCsTAB
nDz
)
{
return
mpImpl
->
updateReference
(
eMode
,
pDoc
,
rWhere
,
nDx
,
nDy
,
nDz
);
}
/* 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