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
7d2619c9
Kaydet (Commit)
7d2619c9
authored
Kas 05, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Set mutex for external ref cache content.
Change-Id: Id00c0e553e08740df8d9b7eef19407e1b0d3f022
üst
29d1303e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
externalrefmgr.hxx
sc/inc/externalrefmgr.hxx
+3
-1
externalrefmgr.cxx
sc/source/ui/docshell/externalrefmgr.cxx
+19
-0
No files found.
sc/inc/externalrefmgr.hxx
Dosyayı görüntüle @
7d2619c9
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include "types.hxx"
#include "types.hxx"
#include "rangelst.hxx"
#include "rangelst.hxx"
#include "formula/token.hxx"
#include "formula/token.hxx"
#include "osl/mutex.hxx"
#include <boost/unordered_map.hpp>
#include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp>
#include <boost/unordered_set.hpp>
...
@@ -340,6 +341,7 @@ private:
...
@@ -340,6 +341,7 @@ private:
DocItem
*
getDocItem
(
sal_uInt16
nFileId
)
const
;
DocItem
*
getDocItem
(
sal_uInt16
nFileId
)
const
;
private
:
private
:
mutable
osl
::
Mutex
maMtxDocs
;
mutable
DocDataType
maDocs
;
mutable
DocDataType
maDocs
;
};
};
...
@@ -682,7 +684,7 @@ public:
...
@@ -682,7 +684,7 @@ public:
*
*
* @return true if the document still contains references to an unsaved file
* @return true if the document still contains references to an unsaved file
*/
*/
bool
containsUnsavedReferences
()
{
return
!
maUnsavedDocShells
.
empty
();
}
bool
containsUnsavedReferences
()
const
{
return
!
maUnsavedDocShells
.
empty
();
}
void
insertRefCell
(
sal_uInt16
nFileId
,
const
ScAddress
&
rCell
);
void
insertRefCell
(
sal_uInt16
nFileId
,
const
ScAddress
&
rCell
);
...
...
sc/source/ui/docshell/externalrefmgr.cxx
Dosyayı görüntüle @
7d2619c9
...
@@ -494,6 +494,8 @@ ScExternalRefCache::~ScExternalRefCache() {}
...
@@ -494,6 +494,8 @@ ScExternalRefCache::~ScExternalRefCache() {}
const
OUString
*
ScExternalRefCache
::
getRealTableName
(
sal_uInt16
nFileId
,
const
OUString
&
rTabName
)
const
const
OUString
*
ScExternalRefCache
::
getRealTableName
(
sal_uInt16
nFileId
,
const
OUString
&
rTabName
)
const
{
{
osl
::
MutexGuard
aGuard
(
&
maMtxDocs
);
DocDataType
::
const_iterator
itrDoc
=
maDocs
.
find
(
nFileId
);
DocDataType
::
const_iterator
itrDoc
=
maDocs
.
find
(
nFileId
);
if
(
itrDoc
==
maDocs
.
end
())
if
(
itrDoc
==
maDocs
.
end
())
{
{
...
@@ -515,6 +517,8 @@ const OUString* ScExternalRefCache::getRealTableName(sal_uInt16 nFileId, const O
...
@@ -515,6 +517,8 @@ const OUString* ScExternalRefCache::getRealTableName(sal_uInt16 nFileId, const O
const
OUString
*
ScExternalRefCache
::
getRealRangeName
(
sal_uInt16
nFileId
,
const
OUString
&
rRangeName
)
const
const
OUString
*
ScExternalRefCache
::
getRealRangeName
(
sal_uInt16
nFileId
,
const
OUString
&
rRangeName
)
const
{
{
osl
::
MutexGuard
aGuard
(
&
maMtxDocs
);
DocDataType
::
const_iterator
itrDoc
=
maDocs
.
find
(
nFileId
);
DocDataType
::
const_iterator
itrDoc
=
maDocs
.
find
(
nFileId
);
if
(
itrDoc
==
maDocs
.
end
())
if
(
itrDoc
==
maDocs
.
end
())
{
{
...
@@ -535,6 +539,8 @@ const OUString* ScExternalRefCache::getRealRangeName(sal_uInt16 nFileId, const O
...
@@ -535,6 +539,8 @@ const OUString* ScExternalRefCache::getRealRangeName(sal_uInt16 nFileId, const O
ScExternalRefCache
::
TokenRef
ScExternalRefCache
::
getCellData
(
ScExternalRefCache
::
TokenRef
ScExternalRefCache
::
getCellData
(
sal_uInt16
nFileId
,
const
OUString
&
rTabName
,
SCCOL
nCol
,
SCROW
nRow
,
sal_uInt32
*
pnFmtIndex
)
sal_uInt16
nFileId
,
const
OUString
&
rTabName
,
SCCOL
nCol
,
SCROW
nRow
,
sal_uInt32
*
pnFmtIndex
)
{
{
osl
::
MutexGuard
aGuard
(
&
maMtxDocs
);
DocDataType
::
const_iterator
itrDoc
=
maDocs
.
find
(
nFileId
);
DocDataType
::
const_iterator
itrDoc
=
maDocs
.
find
(
nFileId
);
if
(
itrDoc
==
maDocs
.
end
())
if
(
itrDoc
==
maDocs
.
end
())
{
{
...
@@ -564,6 +570,8 @@ ScExternalRefCache::TokenRef ScExternalRefCache::getCellData(
...
@@ -564,6 +570,8 @@ ScExternalRefCache::TokenRef ScExternalRefCache::getCellData(
ScExternalRefCache
::
TokenArrayRef
ScExternalRefCache
::
getCellRangeData
(
ScExternalRefCache
::
TokenArrayRef
ScExternalRefCache
::
getCellRangeData
(
sal_uInt16
nFileId
,
const
OUString
&
rTabName
,
const
ScRange
&
rRange
)
sal_uInt16
nFileId
,
const
OUString
&
rTabName
,
const
ScRange
&
rRange
)
{
{
osl
::
MutexGuard
aGuard
(
&
maMtxDocs
);
DocDataType
::
iterator
itrDoc
=
maDocs
.
find
(
nFileId
);
DocDataType
::
iterator
itrDoc
=
maDocs
.
find
(
nFileId
);
if
(
itrDoc
==
maDocs
.
end
())
if
(
itrDoc
==
maDocs
.
end
())
// specified document is not cached.
// specified document is not cached.
...
@@ -673,6 +681,8 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
...
@@ -673,6 +681,8 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
ScExternalRefCache
::
TokenArrayRef
ScExternalRefCache
::
getRangeNameTokens
(
sal_uInt16
nFileId
,
const
OUString
&
rName
)
ScExternalRefCache
::
TokenArrayRef
ScExternalRefCache
::
getRangeNameTokens
(
sal_uInt16
nFileId
,
const
OUString
&
rName
)
{
{
osl
::
MutexGuard
aGuard
(
&
maMtxDocs
);
DocItem
*
pDoc
=
getDocItem
(
nFileId
);
DocItem
*
pDoc
=
getDocItem
(
nFileId
);
if
(
!
pDoc
)
if
(
!
pDoc
)
return
TokenArrayRef
();
return
TokenArrayRef
();
...
@@ -688,6 +698,8 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getRangeNameTokens(sal_uIn
...
@@ -688,6 +698,8 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getRangeNameTokens(sal_uIn
void
ScExternalRefCache
::
setRangeNameTokens
(
sal_uInt16
nFileId
,
const
OUString
&
rName
,
TokenArrayRef
pArray
)
void
ScExternalRefCache
::
setRangeNameTokens
(
sal_uInt16
nFileId
,
const
OUString
&
rName
,
TokenArrayRef
pArray
)
{
{
osl
::
MutexGuard
aGuard
(
&
maMtxDocs
);
DocItem
*
pDoc
=
getDocItem
(
nFileId
);
DocItem
*
pDoc
=
getDocItem
(
nFileId
);
if
(
!
pDoc
)
if
(
!
pDoc
)
return
;
return
;
...
@@ -912,6 +924,8 @@ SCsTAB ScExternalRefCache::getTabSpan( sal_uInt16 nFileId, const OUString& rStar
...
@@ -912,6 +924,8 @@ SCsTAB ScExternalRefCache::getTabSpan( sal_uInt16 nFileId, const OUString& rStar
void
ScExternalRefCache
::
getAllNumberFormats
(
vector
<
sal_uInt32
>&
rNumFmts
)
const
void
ScExternalRefCache
::
getAllNumberFormats
(
vector
<
sal_uInt32
>&
rNumFmts
)
const
{
{
osl
::
MutexGuard
aGuard
(
&
maMtxDocs
);
using
::
std
::
sort
;
using
::
std
::
sort
;
using
::
std
::
unique
;
using
::
std
::
unique
;
...
@@ -986,6 +1000,8 @@ bool ScExternalRefCache::setCacheTableReferenced( sal_uInt16 nFileId, const OUSt
...
@@ -986,6 +1000,8 @@ bool ScExternalRefCache::setCacheTableReferenced( sal_uInt16 nFileId, const OUSt
void
ScExternalRefCache
::
setAllCacheTableReferencedStati
(
bool
bReferenced
)
void
ScExternalRefCache
::
setAllCacheTableReferencedStati
(
bool
bReferenced
)
{
{
osl
::
MutexGuard
aGuard
(
&
maMtxDocs
);
if
(
bReferenced
)
if
(
bReferenced
)
{
{
maReferenced
.
reset
(
0
);
maReferenced
.
reset
(
0
);
...
@@ -1174,11 +1190,14 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF
...
@@ -1174,11 +1190,14 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF
void
ScExternalRefCache
::
clearCache
(
sal_uInt16
nFileId
)
void
ScExternalRefCache
::
clearCache
(
sal_uInt16
nFileId
)
{
{
osl
::
MutexGuard
aGuard
(
&
maMtxDocs
);
maDocs
.
erase
(
nFileId
);
maDocs
.
erase
(
nFileId
);
}
}
ScExternalRefCache
::
DocItem
*
ScExternalRefCache
::
getDocItem
(
sal_uInt16
nFileId
)
const
ScExternalRefCache
::
DocItem
*
ScExternalRefCache
::
getDocItem
(
sal_uInt16
nFileId
)
const
{
{
osl
::
MutexGuard
aGuard
(
&
maMtxDocs
);
using
::
std
::
pair
;
using
::
std
::
pair
;
DocDataType
::
iterator
itrDoc
=
maDocs
.
find
(
nFileId
);
DocDataType
::
iterator
itrDoc
=
maDocs
.
find
(
nFileId
);
if
(
itrDoc
==
maDocs
.
end
())
if
(
itrDoc
==
maDocs
.
end
())
...
...
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