summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/accessibility/SdShapeTypes.cxx130
-rw-r--r--sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx29
-rw-r--r--sd/source/ui/slidesorter/cache/SlsCacheConfiguration.hxx1
3 files changed, 80 insertions, 80 deletions
diff --git a/sd/source/ui/accessibility/SdShapeTypes.cxx b/sd/source/ui/accessibility/SdShapeTypes.cxx
index 3b869c72c568..731829df1cb5 100644
--- a/sd/source/ui/accessibility/SdShapeTypes.cxx
+++ b/sd/source/ui/accessibility/SdShapeTypes.cxx
@@ -70,81 +70,75 @@ AccessibleShape*
}
}
-
-
-
-ShapeTypeDescriptor aSdShapeTypeList[] = {
- ShapeTypeDescriptor (
- PRESENTATION_OUTLINER,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.OutlinerShape"))),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_SUBTITLE,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.SubtitleShape"))),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_GRAPHIC_OBJECT,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.GraphicObjectShape"))),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_PAGE,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.PageShape"))),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_OLE,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.OLE2Shape"))),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_CHART,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.ChartShape"))),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_TABLE,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.TableShape"))),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_NOTES,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.NotesShape"))),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_TITLE,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.TitleTextShape")),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_HANDOUT,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.HandoutShape")),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_HEADER,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.HeaderShape")),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_FOOTER,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.FooterShape")),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_DATETIME,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.DateTimeShape")),
- CreateSdAccessibleShape ),
- ShapeTypeDescriptor (
- PRESENTATION_PAGENUMBER,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.SlideNumberShape")),
- CreateSdAccessibleShape )
-};
-
-
-
-
void RegisterImpressShapeTypes (void)
{
+ /** List of shape type descriptors corresponding to the
+ <type>SdShapeTypes</type> enum.
+ */
+ ShapeTypeDescriptor aSdShapeTypeList[] = {
+ ShapeTypeDescriptor (
+ PRESENTATION_OUTLINER,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.OutlinerShape"))),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_SUBTITLE,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.SubtitleShape"))),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_GRAPHIC_OBJECT,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.GraphicObjectShape"))),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_PAGE,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.PageShape"))),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_OLE,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.OLE2Shape"))),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_CHART,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.ChartShape"))),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_TABLE,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.TableShape"))),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_NOTES,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("com.sun.star.presentation.NotesShape"))),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_TITLE,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.TitleTextShape")),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_HANDOUT,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.HandoutShape")),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_HEADER,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.HeaderShape")),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_FOOTER,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.FooterShape")),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_DATETIME,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.DateTimeShape")),
+ CreateSdAccessibleShape ),
+ ShapeTypeDescriptor (
+ PRESENTATION_PAGENUMBER,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.presentation.SlideNumberShape")),
+ CreateSdAccessibleShape )
+ };
+
ShapeTypeHandler::Instance().AddShapeTypeList (
PRESENTATION_PAGENUMBER - PRESENTATION_OUTLINER + 1,
aSdShapeTypeList);
}
-
-
-
} // end of namespace accessibility
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx b/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx
index 2ea515126c3b..a4d3bc48be46 100644
--- a/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx
@@ -31,6 +31,7 @@
#include "SlsCacheConfiguration.hxx"
#include <osl/mutex.hxx>
+#include <rtl/instance.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/processfactory.hxx>
@@ -43,33 +44,38 @@ using namespace ::com::sun::star::uno;
namespace sd { namespace slidesorter { namespace cache {
-::boost::shared_ptr<CacheConfiguration> CacheConfiguration::mpInstance;
+namespace
+{
+ typedef ::boost::shared_ptr<CacheConfiguration> CacheConfigSharedPtr;
+ class theInstance :
+ public rtl::Static<CacheConfigSharedPtr, theInstance> {};
+}
+
::boost::weak_ptr<CacheConfiguration> CacheConfiguration::mpWeakInstance;
Timer CacheConfiguration::maReleaseTimer;
-
-
::boost::shared_ptr<CacheConfiguration> CacheConfiguration::Instance (void)
{
SolarMutexGuard aSolarGuard;
- if (mpInstance.get() == NULL)
+ CacheConfigSharedPtr &rInstancePtr = theInstance::get();
+ if (rInstancePtr.get() == NULL)
{
// Maybe somebody else kept a previously created instance alive.
if ( ! mpWeakInstance.expired())
- mpInstance = ::boost::shared_ptr<CacheConfiguration>(mpWeakInstance);
- if (mpInstance.get() == NULL)
+ rInstancePtr = ::boost::shared_ptr<CacheConfiguration>(mpWeakInstance);
+ if (rInstancePtr.get() == NULL)
{
// We have to create a new instance.
- mpInstance.reset(new CacheConfiguration());
- mpWeakInstance = mpInstance;
+ rInstancePtr.reset(new CacheConfiguration());
+ mpWeakInstance = rInstancePtr;
// Prepare to release this instance in the near future.
maReleaseTimer.SetTimeoutHdl(
- LINK(mpInstance.get(),CacheConfiguration,TimerCallback));
+ LINK(rInstancePtr.get(),CacheConfiguration,TimerCallback));
maReleaseTimer.SetTimeout(5000 /* 5s */);
maReleaseTimer.Start();
}
}
- return mpInstance;
+ return rInstancePtr;
}
@@ -167,8 +173,9 @@ Any CacheConfiguration::GetValue (const ::rtl::OUString& rName)
IMPL_LINK(CacheConfiguration,TimerCallback, Timer*,EMPTYARG)
{
+ CacheConfigSharedPtr &rInstancePtr = theInstance::get();
// Release out reference to the instance.
- mpInstance.reset();
+ rInstancePtr.reset();
return 0;
}
diff --git a/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.hxx b/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.hxx
index 00a7ad71bdca..b6b113140e50 100644
--- a/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.hxx
+++ b/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.hxx
@@ -56,7 +56,6 @@ public:
::com::sun::star::uno::Any GetValue (const ::rtl::OUString& rName);
private:
- static ::boost::shared_ptr<CacheConfiguration> mpInstance;
/** When a caller holds a reference after we have released ours we use
this weak pointer to avoid creating a new instance.
*/