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
9a0fd9c7
Kaydet (Commit)
9a0fd9c7
authored
May 31, 2016
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: tdf#93386 crash when closing a Database with macro editor open
Change-Id: Id3ecee744cb10f539f2b57e83a4b6e4c7744d3d5
üst
005ae2fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
16 deletions
+38
-16
basicmanagerrepository.cxx
basic/source/basmgr/basicmanagerrepository.cxx
+38
-16
No files found.
basic/source/basmgr/basicmanagerrepository.cxx
Dosyayı görüntüle @
9a0fd9c7
...
@@ -104,6 +104,17 @@ namespace basic
...
@@ -104,6 +104,17 @@ namespace basic
BasicManager
*&
BasicManager
*&
impl_getLocationForModel
(
const
Reference
<
XModel
>&
_rxDocumentModel
);
impl_getLocationForModel
(
const
Reference
<
XModel
>&
_rxDocumentModel
);
/** tests if there is a location set at which the BasicManager for the given model
is stored.
@param _rxDocumentModel
the model whose BasicManager's location is to be retrieved. Must not be <NULL/>.
@precond
our mutex is locked
*/
bool
impl_hasLocationForModel
(
const
Reference
<
XModel
>&
_rxDocumentModel
);
/** creates a new BasicManager instance for the given model
/** creates a new BasicManager instance for the given model
@param _out_rpBasicManager
@param _out_rpBasicManager
...
@@ -113,7 +124,7 @@ namespace basic
...
@@ -113,7 +124,7 @@ namespace basic
@param _rxDocumentModel
@param _rxDocumentModel
the model whose BasicManager will be created. Must not be <NULL/>.
the model whose BasicManager will be created. Must not be <NULL/>.
*/
*/
void
impl_createManagerForModel
(
bool
impl_createManagerForModel
(
BasicManager
*&
_out_rpBasicManager
,
BasicManager
*&
_out_rpBasicManager
,
const
Reference
<
XModel
>&
_rxDocumentModel
);
const
Reference
<
XModel
>&
_rxDocumentModel
);
...
@@ -207,7 +218,6 @@ namespace basic
...
@@ -207,7 +218,6 @@ namespace basic
create
(
CreateImplRepository
(),
::
osl
::
GetGlobalMutex
()
);
create
(
CreateImplRepository
(),
::
osl
::
GetGlobalMutex
()
);
}
}
BasicManager
*
ImplRepository
::
getDocumentBasicManager
(
const
Reference
<
XModel
>&
_rxDocumentModel
)
BasicManager
*
ImplRepository
::
getDocumentBasicManager
(
const
Reference
<
XModel
>&
_rxDocumentModel
)
{
{
SolarMutexGuard
g
;
SolarMutexGuard
g
;
...
@@ -221,13 +231,13 @@ namespace basic
...
@@ -221,13 +231,13 @@ namespace basic
without creating another instance.
without creating another instance.
*/
*/
BasicManager
*&
pBasicManager
=
impl_getLocationForModel
(
_rxDocumentModel
);
BasicManager
*&
pBasicManager
=
impl_getLocationForModel
(
_rxDocumentModel
);
if
(
pBasicManager
==
nullptr
)
if
(
pBasicManager
!=
nullptr
)
impl_createManagerForModel
(
pBasicManager
,
_rxDocumentModel
);
return
pBasicManager
;
if
(
impl_createManagerForModel
(
pBasicManager
,
_rxDocumentModel
))
return
pBasicManager
;
return
pBasicManager
;
return
nullptr
;
}
}
BasicManager
*
ImplRepository
::
getApplicationBasicManager
(
bool
_bCreate
)
BasicManager
*
ImplRepository
::
getApplicationBasicManager
(
bool
_bCreate
)
{
{
SolarMutexGuard
g
;
SolarMutexGuard
g
;
...
@@ -353,7 +363,6 @@ namespace basic
...
@@ -353,7 +363,6 @@ namespace basic
return
pAppBasic
;
return
pAppBasic
;
}
}
BasicManager
*&
ImplRepository
::
impl_getLocationForModel
(
const
Reference
<
XModel
>&
_rxDocumentModel
)
BasicManager
*&
ImplRepository
::
impl_getLocationForModel
(
const
Reference
<
XModel
>&
_rxDocumentModel
)
{
{
Reference
<
XInterface
>
xNormalized
(
_rxDocumentModel
,
UNO_QUERY
);
Reference
<
XInterface
>
xNormalized
(
_rxDocumentModel
,
UNO_QUERY
);
...
@@ -363,6 +372,13 @@ namespace basic
...
@@ -363,6 +372,13 @@ namespace basic
return
location
;
return
location
;
}
}
bool
ImplRepository
::
impl_hasLocationForModel
(
const
Reference
<
XModel
>&
_rxDocumentModel
)
{
Reference
<
XInterface
>
xNormalized
(
_rxDocumentModel
,
UNO_QUERY
);
DBG_ASSERT
(
_rxDocumentModel
.
is
(),
"ImplRepository::impl_getLocationForModel: invalid model!"
);
return
m_aStore
.
find
(
xNormalized
)
!=
m_aStore
.
end
();
}
void
ImplRepository
::
impl_initDocLibraryContainers_nothrow
(
const
Reference
<
XPersistentLibraryContainer
>&
_rxBasicLibraries
,
const
Reference
<
XPersistentLibraryContainer
>&
_rxDialogLibraries
)
void
ImplRepository
::
impl_initDocLibraryContainers_nothrow
(
const
Reference
<
XPersistentLibraryContainer
>&
_rxBasicLibraries
,
const
Reference
<
XPersistentLibraryContainer
>&
_rxDialogLibraries
)
{
{
...
@@ -389,8 +405,7 @@ namespace basic
...
@@ -389,8 +405,7 @@ namespace basic
}
}
}
}
bool
ImplRepository
::
impl_createManagerForModel
(
BasicManager
*&
_out_rpBasicManager
,
const
Reference
<
XModel
>&
_rxDocumentModel
)
void
ImplRepository
::
impl_createManagerForModel
(
BasicManager
*&
_out_rpBasicManager
,
const
Reference
<
XModel
>&
_rxDocumentModel
)
{
{
StarBASIC
*
pAppBasic
=
impl_getDefaultAppBasicLibrary
();
StarBASIC
*
pAppBasic
=
impl_getDefaultAppBasicLibrary
();
...
@@ -399,13 +414,13 @@ namespace basic
...
@@ -399,13 +414,13 @@ namespace basic
if
(
!
impl_getDocumentStorage_nothrow
(
_rxDocumentModel
,
xStorage
)
)
if
(
!
impl_getDocumentStorage_nothrow
(
_rxDocumentModel
,
xStorage
)
)
{
{
// the document is not able to provide the storage it is based on.
// the document is not able to provide the storage it is based on.
return
;
return
false
;
}
}
Reference
<
XPersistentLibraryContainer
>
xBasicLibs
;
Reference
<
XPersistentLibraryContainer
>
xBasicLibs
;
Reference
<
XPersistentLibraryContainer
>
xDialogLibs
;
Reference
<
XPersistentLibraryContainer
>
xDialogLibs
;
if
(
!
impl_getDocumentLibraryContainers_nothrow
(
_rxDocumentModel
,
xBasicLibs
,
xDialogLibs
)
)
if
(
!
impl_getDocumentLibraryContainers_nothrow
(
_rxDocumentModel
,
xBasicLibs
,
xDialogLibs
)
)
// the document does not have BasicLibraries and DialogLibraries
// the document does not have BasicLibraries and DialogLibraries
return
;
return
false
;
if
(
xStorage
.
is
()
)
if
(
xStorage
.
is
()
)
{
{
...
@@ -466,20 +481,27 @@ namespace basic
...
@@ -466,20 +481,27 @@ namespace basic
// register as listener for this model being disposed/closed
// register as listener for this model being disposed/closed
OSL_ENSURE
(
_rxDocumentModel
.
is
(),
"ImplRepository::impl_createManagerForModel: the document must be an XComponent!"
);
OSL_ENSURE
(
_rxDocumentModel
.
is
(),
"ImplRepository::impl_createManagerForModel: the document must be an XComponent!"
);
assert
(
impl_hasLocationForModel
(
_rxDocumentModel
));
startComponentListening
(
_rxDocumentModel
);
startComponentListening
(
_rxDocumentModel
);
// register as listener for the BasicManager being destroyed
bool
bOk
=
false
;
StartListening
(
*
_out_rpBasicManager
);
// startComponentListening may fail in a disposed _rxDocumentModel, in which case _out_rpBasicManager will be removed
// from the map and destroyed
if
(
impl_hasLocationForModel
(
_rxDocumentModel
))
{
bOk
=
true
;
// register as listener for the BasicManager being destroyed
StartListening
(
*
_out_rpBasicManager
);
}
// #i104876: Library container must not be modified just after
// #i104876: Library container must not be modified just after
// creation. This happens as side effect when creating default
// creation. This happens as side effect when creating default
// "Standard" libraries and needs to be corrected here
// "Standard" libraries and needs to be corrected here
xBasicLibs
->
setModified
(
false
);
xBasicLibs
->
setModified
(
false
);
xDialogLibs
->
setModified
(
false
);
xDialogLibs
->
setModified
(
false
);
return
bOk
;
}
}
bool
ImplRepository
::
impl_getDocumentStorage_nothrow
(
const
Reference
<
XModel
>&
_rxDocument
,
Reference
<
XStorage
>&
_out_rStorage
)
bool
ImplRepository
::
impl_getDocumentStorage_nothrow
(
const
Reference
<
XModel
>&
_rxDocument
,
Reference
<
XStorage
>&
_out_rStorage
)
{
{
_out_rStorage
.
clear
();
_out_rStorage
.
clear
();
...
...
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