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
bb6bd1ff
Kaydet (Commit)
bb6bd1ff
authored
Agu 10, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#53210 SwDoc::UpdateExpFlds don't crash when hiding all sections
Change-Id: I9b7a61f18f987214708195a89f6e346c865c7f9f
üst
369da987
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
docfld.cxx
sw/source/core/doc/docfld.cxx
+26
-1
No files found.
sw/source/core/doc/docfld.cxx
Dosyayı görüntüle @
bb6bd1ff
...
...
@@ -1288,6 +1288,15 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
SwNewDBMgr
*
pMgr
=
GetNewDBMgr
();
pMgr
->
CloseAll
(
sal_False
);
// Make sure we don't hide all sections, which would lead to a crash. First, count how many of them do we have.
int
nShownSections
=
0
;
for
(
_SetGetExpFlds
::
const_iterator
it
=
pUpdtFlds
->
GetSortLst
()
->
begin
();
it
!=
pUpdtFlds
->
GetSortLst
()
->
end
();
++
it
)
{
SwSection
*
pSect
=
(
SwSection
*
)(
*
it
)
->
GetSection
();
if
(
pSect
&&
!
pSect
->
IsCondHidden
())
nShownSections
++
;
}
String
aNew
;
for
(
_SetGetExpFlds
::
const_iterator
it
=
pUpdtFlds
->
GetSortLst
()
->
begin
();
it
!=
pUpdtFlds
->
GetSortLst
()
->
end
();
++
it
)
{
...
...
@@ -1298,7 +1307,23 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
SwSbxValue
aValue
=
aCalc
.
Calculate
(
pSect
->
GetCondition
()
);
if
(
!
aValue
.
IsVoidValue
())
pSect
->
SetCondHidden
(
aValue
.
GetBool
()
);
{
// Do we want to hide this one?
bool
bHide
=
aValue
.
GetBool
();
if
(
bHide
&&
!
pSect
->
IsCondHidden
())
{
// This section will be hidden, but it wasn't before
if
(
nShownSections
==
1
)
{
// This would be the last section, so set its condition to false, and avoid hiding it.
OUString
aCond
(
"0"
);
pSect
->
SetCondition
(
aCond
);
bHide
=
false
;
}
nShownSections
--
;
}
pSect
->
SetCondHidden
(
bHide
);
}
continue
;
}
...
...
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