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
05327339
Kaydet (Commit)
05327339
authored
Ock 29, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bool cleanup with ScEditableTester.
Change-Id: If4ae85bec451897f5c22397f4301200d1d3c77ac
üst
80f5a837
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
32 deletions
+27
-32
editable.cxx
sc/source/ui/docshell/editable.cxx
+23
-25
editable.hxx
sc/source/ui/inc/editable.hxx
+4
-7
No files found.
sc/source/ui/docshell/editable.cxx
Dosyayı görüntüle @
05327339
...
...
@@ -23,18 +23,16 @@
#include "globstr.hrc"
#include "markdata.hxx"
//------------------------------------------------------------------
ScEditableTester
::
ScEditableTester
()
:
bIsEditable
(
sal_True
),
bOnlyMatrix
(
sal_True
)
mbIsEditable
(
true
),
mbOnlyMatrix
(
true
)
{
}
ScEditableTester
::
ScEditableTester
(
ScDocument
*
pDoc
,
SCTAB
nTab
,
SCCOL
nStartCol
,
SCROW
nStartRow
,
SCCOL
nEndCol
,
SCROW
nEndRow
)
:
bIsEditable
(
sal_True
),
bOnlyMatrix
(
sal_True
)
mbIsEditable
(
true
),
mbOnlyMatrix
(
true
)
{
TestBlock
(
pDoc
,
nTab
,
nStartCol
,
nStartRow
,
nEndCol
,
nEndRow
);
}
...
...
@@ -42,29 +40,29 @@ ScEditableTester::ScEditableTester( ScDocument* pDoc, SCTAB nTab,
ScEditableTester
::
ScEditableTester
(
ScDocument
*
pDoc
,
SCCOL
nStartCol
,
SCROW
nStartRow
,
SCCOL
nEndCol
,
SCROW
nEndRow
,
const
ScMarkData
&
rMark
)
:
bIsEditable
(
sal_True
),
bOnlyMatrix
(
sal_True
)
mbIsEditable
(
true
),
mbOnlyMatrix
(
true
)
{
TestSelectedBlock
(
pDoc
,
nStartCol
,
nStartRow
,
nEndCol
,
nEndRow
,
rMark
);
}
ScEditableTester
::
ScEditableTester
(
ScDocument
*
pDoc
,
const
ScRange
&
rRange
)
:
bIsEditable
(
sal_True
),
bOnlyMatrix
(
sal_True
)
mbIsEditable
(
true
),
mbOnlyMatrix
(
true
)
{
TestRange
(
pDoc
,
rRange
);
}
ScEditableTester
::
ScEditableTester
(
ScDocument
*
pDoc
,
const
ScMarkData
&
rMark
)
:
bIsEditable
(
sal_True
),
bOnlyMatrix
(
sal_True
)
mbIsEditable
(
true
),
mbOnlyMatrix
(
true
)
{
TestSelection
(
pDoc
,
rMark
);
}
ScEditableTester
::
ScEditableTester
(
ScViewFunc
*
pView
)
:
bIsEditable
(
sal_True
),
bOnlyMatrix
(
sal_True
)
mbIsEditable
(
true
),
mbOnlyMatrix
(
true
)
{
TestView
(
pView
);
}
...
...
@@ -74,14 +72,14 @@ ScEditableTester::ScEditableTester( ScViewFunc* pView ) :
void
ScEditableTester
::
TestBlock
(
ScDocument
*
pDoc
,
SCTAB
nTab
,
SCCOL
nStartCol
,
SCROW
nStartRow
,
SCCOL
nEndCol
,
SCROW
nEndRow
)
{
if
(
bIsEditable
||
bOnlyMatrix
)
if
(
mbIsEditable
||
mbOnlyMatrix
)
{
bool
bThisMatrix
;
if
(
!
pDoc
->
IsBlockEditable
(
nTab
,
nStartCol
,
nStartRow
,
nEndCol
,
nEndRow
,
&
bThisMatrix
)
)
{
bIsEditable
=
false
;
m
bIsEditable
=
false
;
if
(
!
bThisMatrix
)
bOnlyMatrix
=
false
;
m
bOnlyMatrix
=
false
;
}
}
}
...
...
@@ -110,28 +108,28 @@ void ScEditableTester::TestRange( ScDocument* pDoc, const ScRange& rRange )
void
ScEditableTester
::
TestSelection
(
ScDocument
*
pDoc
,
const
ScMarkData
&
rMark
)
{
if
(
bIsEditable
||
bOnlyMatrix
)
if
(
mbIsEditable
||
mbOnlyMatrix
)
{
bool
bThisMatrix
;
if
(
!
pDoc
->
IsSelectionEditable
(
rMark
,
&
bThisMatrix
)
)
{
bIsEditable
=
false
;
m
bIsEditable
=
false
;
if
(
!
bThisMatrix
)
bOnlyMatrix
=
false
;
m
bOnlyMatrix
=
false
;
}
}
}
void
ScEditableTester
::
TestView
(
ScViewFunc
*
pView
)
{
if
(
bIsEditable
||
bOnlyMatrix
)
if
(
mbIsEditable
||
mbOnlyMatrix
)
{
bool
bThisMatrix
;
if
(
!
pView
->
SelectionEditable
(
&
bThisMatrix
)
)
{
bIsEditable
=
false
;
m
bIsEditable
=
false
;
if
(
!
bThisMatrix
)
bOnlyMatrix
=
false
;
m
bOnlyMatrix
=
false
;
}
}
}
...
...
@@ -140,9 +138,9 @@ void ScEditableTester::TestView( ScViewFunc* pView )
sal_uInt16
ScEditableTester
::
GetMessageId
()
const
{
if
(
bIsEditable
)
if
(
m
bIsEditable
)
return
0
;
else
if
(
bOnlyMatrix
)
else
if
(
m
bOnlyMatrix
)
return
STR_MATRIXFRAGMENTERR
;
else
return
STR_PROTECTIONERR
;
...
...
sc/source/ui/inc/editable.hxx
Dosyayı görüntüle @
05327339
...
...
@@ -31,11 +31,10 @@ class ScRange;
class
ScEditableTester
{
sal_Bool
bIsEditable
;
sal_Bool
bOnlyMatrix
;
bool
m
bIsEditable
;
bool
m
bOnlyMatrix
;
public
:
// no test in ctor
ScEditableTester
();
// calls TestBlock
...
...
@@ -56,8 +55,6 @@ public:
// calls TestView
ScEditableTester
(
ScViewFunc
*
pView
);
~
ScEditableTester
()
{}
// Several calls to the Test... methods check if *all* of the ranges
// are editable. For several independent checks, Reset() has to be used.
void
TestBlock
(
ScDocument
*
pDoc
,
SCTAB
nTab
,
...
...
@@ -69,8 +66,8 @@ public:
void
TestSelection
(
ScDocument
*
pDoc
,
const
ScMarkData
&
rMark
);
void
TestView
(
ScViewFunc
*
pView
);
sal_Bool
IsEditable
()
const
{
return
bIsEditable
;
}
sal_Bool
IsFormatEditable
()
const
{
return
bIsEditable
||
bOnlyMatrix
;
}
bool
IsEditable
()
const
{
return
m
bIsEditable
;
}
bool
IsFormatEditable
()
const
{
return
mbIsEditable
||
m
bOnlyMatrix
;
}
sal_uInt16
GetMessageId
()
const
;
};
...
...
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