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
db0e131d
Kaydet (Commit)
db0e131d
authored
Eki 14, 2004
tarafından
Andreas Schlüns
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#118074# handle non existing accelerator configs gracefully
üst
82e69e95
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
62 deletions
+88
-62
documentacceleratorconfiguration.cxx
.../source/accelerators/documentacceleratorconfiguration.cxx
+29
-20
globalacceleratorconfiguration.cxx
...rk/source/accelerators/globalacceleratorconfiguration.cxx
+29
-21
moduleacceleratorconfiguration.cxx
...rk/source/accelerators/moduleacceleratorconfiguration.cxx
+30
-21
No files found.
framework/source/accelerators/documentacceleratorconfiguration.cxx
Dosyayı görüntüle @
db0e131d
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: documentacceleratorconfiguration.cxx,v $
*
* $Revision: 1.
2
$
* $Revision: 1.
3
$
*
* last change: $Author:
rt $ $Date: 2004-09-20 10:05:46
$
* last change: $Author:
as $ $Date: 2004-10-14 09:26:21
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -150,11 +150,6 @@ void SAL_CALL DocumentAcceleratorConfiguration::initialize(const css::uno::Seque
::
rtl
::
OUString
::
createFromAscii
(
"DocumentRoot"
),
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
());
if
(
!
m_xDocumentRoot
.
is
())
throw
css
::
uno
::
RuntimeException
(
::
rtl
::
OUString
::
createFromAscii
(
"The document dependend accelerator configuration was initialized with an invalid roo storage!"
),
static_cast
<
::
cppu
::
OWeakObject
*
>
(
this
));
aWriteLock
.
unlock
();
// <- SAFE ----------------------------------
...
...
@@ -170,24 +165,38 @@ void DocumentAcceleratorConfiguration::impl_ts_fillCache()
aReadLock
.
unlock
();
// <- SAFE ----------------------------------
// Sometimes we must live without a document root.
// E.g. if the document is readonly ...
if
(
!
xDocumentRoot
.
is
())
return
;
// get current office locale ... but dont cache it.
// Otherwise we must be listener on the configuration layer
// which seems to superflous for this small implementation .-)
::
comphelper
::
Locale
aLocale
=
impl_ts_getLocale
();
// Note: The used preset class is threadsafe by itself ... and live if we live!
// We do not need any mutex here.
// open the folder, where the configuration exists
m_aPresetHandler
.
connectToResource
(
PresetHandler
::
E_DOCUMENT
,
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
::
rtl
::
OUString
(),
xDocumentRoot
,
aLocale
);
AcceleratorConfiguration
::
reload
();
m_aPresetHandler
.
addStorageListener
(
this
);
// May be the current document does not contain any
// accelerator config? Handle it gracefully :-)
try
{
// Note: The used preset class is threadsafe by itself ... and live if we live!
// We do not need any mutex here.
// open the folder, where the configuration exists
m_aPresetHandler
.
connectToResource
(
PresetHandler
::
E_DOCUMENT
,
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
::
rtl
::
OUString
(),
xDocumentRoot
,
aLocale
);
AcceleratorConfiguration
::
reload
();
m_aPresetHandler
.
addStorageListener
(
this
);
}
catch
(
const
css
::
uno
::
RuntimeException
&
exRun
)
{
throw
exRun
;
}
catch
(
const
css
::
uno
::
Exception
&
)
{}
}
}
// namespace framework
framework/source/accelerators/globalacceleratorconfiguration.cxx
Dosyayı görüntüle @
db0e131d
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: globalacceleratorconfiguration.cxx,v $
*
* $Revision: 1.
2
$
* $Revision: 1.
3
$
*
* last change: $Author:
rt $ $Date: 2004-09-20 10:05:55
$
* last change: $Author:
as $ $Date: 2004-10-14 09:26:21
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -159,25 +159,33 @@ void GlobalAcceleratorConfiguration::impl_ts_fillCache()
// which seems to superflous for this small implementation .-)
::
comphelper
::
Locale
aLocale
=
impl_ts_getLocale
();
// Note: The used preset class is threadsafe by itself ... and live if we live!
// We do not need any mutex here.
// open the folder, where the configuration exists
m_aPresetHandler
.
connectToResource
(
PresetHandler
::
E_GLOBAL
,
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
::
rtl
::
OUString
(),
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
(),
aLocale
);
// check if the user already has a current configuration
// if not - se the default preset as new current one.
// means: copy "share/default.xml" => "user/current.xml"
if
(
!
m_aPresetHandler
.
existsTarget
(
PresetHandler
::
TARGET_CURRENT
()))
m_aPresetHandler
.
copyPresetToTarget
(
PresetHandler
::
PRESET_DEFAULT
(),
PresetHandler
::
TARGET_CURRENT
());
AcceleratorConfiguration
::
reload
();
m_aPresetHandler
.
addStorageListener
(
this
);
// May be there exists no accelerator config? Handle it gracefully :-)
try
{
// Note: The used preset class is threadsafe by itself ... and live if we live!
// We do not need any mutex here.
// open the folder, where the configuration exists
m_aPresetHandler
.
connectToResource
(
PresetHandler
::
E_GLOBAL
,
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
::
rtl
::
OUString
(),
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
(),
aLocale
);
// check if the user already has a current configuration
// if not - se the default preset as new current one.
// means: copy "share/default.xml" => "user/current.xml"
if
(
!
m_aPresetHandler
.
existsTarget
(
PresetHandler
::
TARGET_CURRENT
()))
m_aPresetHandler
.
copyPresetToTarget
(
PresetHandler
::
PRESET_DEFAULT
(),
PresetHandler
::
TARGET_CURRENT
());
AcceleratorConfiguration
::
reload
();
m_aPresetHandler
.
addStorageListener
(
this
);
}
catch
(
const
css
::
uno
::
RuntimeException
&
exRun
)
{
throw
exRun
;
}
catch
(
const
css
::
uno
::
Exception
&
)
{}
}
}
// namespace framework
framework/source/accelerators/moduleacceleratorconfiguration.cxx
Dosyayı görüntüle @
db0e131d
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: moduleacceleratorconfiguration.cxx,v $
*
* $Revision: 1.
2
$
* $Revision: 1.
3
$
*
* last change: $Author:
rt $ $Date: 2004-09-20 10:06:24
$
* last change: $Author:
as $ $Date: 2004-10-14 09:26:22
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -189,25 +189,34 @@ void ModuleAcceleratorConfiguration::impl_ts_fillCache()
// which seems to superflous for this small implementation .-)
::
comphelper
::
Locale
aLocale
=
impl_ts_getLocale
();
// Note: The used preset class is threadsafe by itself ... and live if we live!
// We do not need any mutex here.
// open the folder, where the configuration exists
m_aPresetHandler
.
connectToResource
(
PresetHandler
::
E_MODULES
,
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
sModule
,
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
(),
aLocale
);
// check if the user already has a current configuration
// if not - se the default preset as new current one.
// means: copy "share/default.xml" => "user/current.xml"
if
(
!
m_aPresetHandler
.
existsTarget
(
PresetHandler
::
TARGET_CURRENT
()))
m_aPresetHandler
.
copyPresetToTarget
(
PresetHandler
::
PRESET_DEFAULT
(),
PresetHandler
::
TARGET_CURRENT
());
AcceleratorConfiguration
::
reload
();
m_aPresetHandler
.
addStorageListener
(
this
);
// May be the current app module does not have any
// accelerator config? Handle it gracefully :-)
try
{
// Note: The used preset class is threadsafe by itself ... and live if we live!
// We do not need any mutex here.
// open the folder, where the configuration exists
m_aPresetHandler
.
connectToResource
(
PresetHandler
::
E_MODULES
,
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
sModule
,
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
(),
aLocale
);
// check if the user already has a current configuration
// if not - se the default preset as new current one.
// means: copy "share/default.xml" => "user/current.xml"
if
(
!
m_aPresetHandler
.
existsTarget
(
PresetHandler
::
TARGET_CURRENT
()))
m_aPresetHandler
.
copyPresetToTarget
(
PresetHandler
::
PRESET_DEFAULT
(),
PresetHandler
::
TARGET_CURRENT
());
AcceleratorConfiguration
::
reload
();
m_aPresetHandler
.
addStorageListener
(
this
);
}
catch
(
const
css
::
uno
::
RuntimeException
&
exRun
)
{
throw
exRun
;
}
catch
(
const
css
::
uno
::
Exception
&
)
{}
}
}
// namespace framework
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