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 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: documentacceleratorconfiguration.cxx,v $
* $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
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -150,11 +150,6 @@ void SAL_CALL DocumentAcceleratorConfiguration::initialize(const css::uno::Seque
...
@@ -150,11 +150,6 @@ void SAL_CALL DocumentAcceleratorConfiguration::initialize(const css::uno::Seque
::
rtl
::
OUString
::
createFromAscii
(
"DocumentRoot"
),
::
rtl
::
OUString
::
createFromAscii
(
"DocumentRoot"
),
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
());
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
();
aWriteLock
.
unlock
();
// <- SAFE ----------------------------------
// <- SAFE ----------------------------------
...
@@ -170,24 +165,38 @@ void DocumentAcceleratorConfiguration::impl_ts_fillCache()
...
@@ -170,24 +165,38 @@ void DocumentAcceleratorConfiguration::impl_ts_fillCache()
aReadLock
.
unlock
();
aReadLock
.
unlock
();
// <- SAFE ----------------------------------
// <- 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.
// get current office locale ... but dont cache it.
// Otherwise we must be listener on the configuration layer
// Otherwise we must be listener on the configuration layer
// which seems to superflous for this small implementation .-)
// which seems to superflous for this small implementation .-)
::
comphelper
::
Locale
aLocale
=
impl_ts_getLocale
();
::
comphelper
::
Locale
aLocale
=
impl_ts_getLocale
();
// Note: The used preset class is threadsafe by itself ... and live if we live!
// May be the current document does not contain any
// We do not need any mutex here.
// accelerator config? Handle it gracefully :-)
try
// open the folder, where the configuration exists
{
m_aPresetHandler
.
connectToResource
(
// Note: The used preset class is threadsafe by itself ... and live if we live!
PresetHandler
::
E_DOCUMENT
,
// We do not need any mutex here.
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
::
rtl
::
OUString
(),
// open the folder, where the configuration exists
xDocumentRoot
,
m_aPresetHandler
.
connectToResource
(
aLocale
);
PresetHandler
::
E_DOCUMENT
,
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
AcceleratorConfiguration
::
reload
();
::
rtl
::
OUString
(),
m_aPresetHandler
.
addStorageListener
(
this
);
xDocumentRoot
,
aLocale
);
AcceleratorConfiguration
::
reload
();
m_aPresetHandler
.
addStorageListener
(
this
);
}
catch
(
const
css
::
uno
::
RuntimeException
&
exRun
)
{
throw
exRun
;
}
catch
(
const
css
::
uno
::
Exception
&
)
{}
}
}
}
// namespace framework
}
// namespace framework
framework/source/accelerators/globalacceleratorconfiguration.cxx
Dosyayı görüntüle @
db0e131d
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: globalacceleratorconfiguration.cxx,v $
* $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
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -159,25 +159,33 @@ void GlobalAcceleratorConfiguration::impl_ts_fillCache()
...
@@ -159,25 +159,33 @@ void GlobalAcceleratorConfiguration::impl_ts_fillCache()
// which seems to superflous for this small implementation .-)
// which seems to superflous for this small implementation .-)
::
comphelper
::
Locale
aLocale
=
impl_ts_getLocale
();
::
comphelper
::
Locale
aLocale
=
impl_ts_getLocale
();
// Note: The used preset class is threadsafe by itself ... and live if we live!
// May be there exists no accelerator config? Handle it gracefully :-)
// We do not need any mutex here.
try
{
// open the folder, where the configuration exists
// Note: The used preset class is threadsafe by itself ... and live if we live!
m_aPresetHandler
.
connectToResource
(
// We do not need any mutex here.
PresetHandler
::
E_GLOBAL
,
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
// open the folder, where the configuration exists
::
rtl
::
OUString
(),
m_aPresetHandler
.
connectToResource
(
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
(),
PresetHandler
::
E_GLOBAL
,
aLocale
);
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
::
rtl
::
OUString
(),
// check if the user already has a current configuration
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
(),
// if not - se the default preset as new current one.
aLocale
);
// means: copy "share/default.xml" => "user/current.xml"
if
(
!
m_aPresetHandler
.
existsTarget
(
PresetHandler
::
TARGET_CURRENT
()))
// check if the user already has a current configuration
m_aPresetHandler
.
copyPresetToTarget
(
PresetHandler
::
PRESET_DEFAULT
(),
PresetHandler
::
TARGET_CURRENT
());
// if not - se the default preset as new current one.
// means: copy "share/default.xml" => "user/current.xml"
AcceleratorConfiguration
::
reload
();
if
(
!
m_aPresetHandler
.
existsTarget
(
PresetHandler
::
TARGET_CURRENT
()))
m_aPresetHandler
.
addStorageListener
(
this
);
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
}
// namespace framework
framework/source/accelerators/moduleacceleratorconfiguration.cxx
Dosyayı görüntüle @
db0e131d
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: moduleacceleratorconfiguration.cxx,v $
* $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
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -189,25 +189,34 @@ void ModuleAcceleratorConfiguration::impl_ts_fillCache()
...
@@ -189,25 +189,34 @@ void ModuleAcceleratorConfiguration::impl_ts_fillCache()
// which seems to superflous for this small implementation .-)
// which seems to superflous for this small implementation .-)
::
comphelper
::
Locale
aLocale
=
impl_ts_getLocale
();
::
comphelper
::
Locale
aLocale
=
impl_ts_getLocale
();
// Note: The used preset class is threadsafe by itself ... and live if we live!
// May be the current app module does not have any
// We do not need any mutex here.
// accelerator config? Handle it gracefully :-)
try
// open the folder, where the configuration exists
{
m_aPresetHandler
.
connectToResource
(
// Note: The used preset class is threadsafe by itself ... and live if we live!
PresetHandler
::
E_MODULES
,
// We do not need any mutex here.
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
sModule
,
// open the folder, where the configuration exists
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
(),
m_aPresetHandler
.
connectToResource
(
aLocale
);
PresetHandler
::
E_MODULES
,
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
// check if the user already has a current configuration
sModule
,
// if not - se the default preset as new current one.
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
(),
// means: copy "share/default.xml" => "user/current.xml"
aLocale
);
if
(
!
m_aPresetHandler
.
existsTarget
(
PresetHandler
::
TARGET_CURRENT
()))
m_aPresetHandler
.
copyPresetToTarget
(
PresetHandler
::
PRESET_DEFAULT
(),
PresetHandler
::
TARGET_CURRENT
());
// check if the user already has a current configuration
// if not - se the default preset as new current one.
AcceleratorConfiguration
::
reload
();
// means: copy "share/default.xml" => "user/current.xml"
m_aPresetHandler
.
addStorageListener
(
this
);
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
}
// 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