[Libreoffice-commits] core.git: 19 commits - canvas/source chart2/Library_chartcontroller.mk chart2/source comphelper/source compilerplugins/clang dbaccess/source extensions/source framework/inc framework/source include/canvas include/comphelper linguistic/inc linguistic/source store/source svtools/source sw/inc sw/source
Noel Grandin
noel at peralex.com
Tue Oct 6 23:28:17 PDT 2015
canvas/source/directx/dx_surfacebitmap.hxx | 2
canvas/source/tools/surfaceproxy.hxx | 2
canvas/source/tools/surfaceproxymanager.cxx | 4
chart2/Library_chartcontroller.mk | 1
chart2/source/controller/inc/ChartController.hxx | 12
chart2/source/controller/main/ChartController.cxx | 18
chart2/source/controller/main/UndoActions.hxx | 2
chart2/source/inc/ConfigColorScheme.hxx | 8
chart2/source/inc/ConfigItemListener.hxx | 42 --
chart2/source/tools/ConfigColorScheme.cxx | 16
comphelper/source/container/enumerablemap.cxx | 55 --
compilerplugins/clang/mergeclasses.results | 17
dbaccess/source/ui/inc/propertystorage.hxx | 34 -
dbaccess/source/ui/misc/propertystorage.cxx | 8
extensions/source/resource/oooresourceloader.cxx | 33 -
framework/inc/helper/ilayoutnotifications.hxx | 46 --
framework/inc/services/layoutmanager.hxx | 14
framework/inc/uielement/comboboxtoolbarcontroller.hxx | 34 -
framework/inc/uielement/dropdownboxtoolbarcontroller.hxx | 27 -
framework/inc/uielement/edittoolbarcontroller.hxx | 28 -
framework/inc/uielement/spinfieldtoolbarcontroller.hxx | 43 --
framework/source/accelerators/acceleratorconfiguration.cxx | 2
framework/source/accelerators/documentacceleratorconfiguration.cxx | 1
framework/source/accelerators/presethandler.cxx | 4
framework/source/accelerators/storageholder.cxx | 9
framework/source/inc/accelerators/acceleratorconfiguration.hxx | 8
framework/source/inc/accelerators/istoragelistener.hxx | 49 --
framework/source/inc/accelerators/presethandler.hxx | 4
framework/source/inc/accelerators/storageholder.hxx | 8
framework/source/layoutmanager/toolbarlayoutmanager.cxx | 20 -
framework/source/layoutmanager/toolbarlayoutmanager.hxx | 6
framework/source/uielement/comboboxtoolbarcontroller.cxx | 40 +-
framework/source/uielement/dropdownboxtoolbarcontroller.cxx | 6
framework/source/uielement/edittoolbarcontroller.cxx | 30 -
framework/source/uielement/spinfieldtoolbarcontroller.cxx | 54 +-
include/canvas/rendering/isurfaceproxy.hxx | 2
include/comphelper/interaction.hxx | 36 -
linguistic/inc/iprcache.hxx | 32 -
linguistic/source/iprcache.cxx | 23 -
store/source/object.hxx | 48 --
store/source/storcach.cxx | 191 ++--------
store/source/storcach.hxx | 58 +--
store/source/stordir.hxx | 4
store/source/store.cxx | 6
store/source/storlckb.hxx | 4
store/source/storpage.hxx | 4
svtools/source/table/cellvalueconversion.cxx | 49 +-
sw/inc/edimp.hxx | 19
sw/source/core/edit/edattr.cxx | 2
sw/source/core/edit/ednumber.cxx | 44 +-
sw/source/core/unocore/unocrsrhelper.cxx | 4
sw/source/core/unocore/unoobj.cxx | 2
52 files changed, 374 insertions(+), 841 deletions(-)
New commits:
commit 8b98c8b32cc2ba1693f26aef52d3825caabea606
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 15:22:45 2015 +0200
loplugin:mergeclasses
Change-Id: I52446e517c2315516ea74a30767393ff32960799
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index d8b0425..a5461e1 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -260,7 +260,6 @@ merge svt::IEditImplementation with svt::GenericEditImplementation
merge svt::IEnumerationResultHandler with SvtFileView_Impl
merge svt::IFilePickerController with SvtFileDialog_Base
merge svt::IFilePickerListener with SvtFilePicker
-merge svt::IValueNormalization with svt::StandardFormatNormalizer
merge svt::table::IAccessibleTable with svt::table::TableControl
merge svt::table::IAccessibleTableControl with accessibility::AccessibleGridControlAccess
merge svt::table::IColumnModel with svt::table::UnoGridColumnFacade
diff --git a/svtools/source/table/cellvalueconversion.cxx b/svtools/source/table/cellvalueconversion.cxx
index 32315c2..0fa47bd 100644
--- a/svtools/source/table/cellvalueconversion.cxx
+++ b/svtools/source/table/cellvalueconversion.cxx
@@ -80,30 +80,12 @@ namespace svt
}
- //= IValueNormalization
-
- class SAL_NO_VTABLE IValueNormalization
- {
- public:
- virtual ~IValueNormalization() { }
-
- /** converts the given <code>Any</code> into a <code>double</code> value to be fed into a number formatter
- */
- virtual double convertToDouble( Any const & i_value ) const = 0;
-
- /** returns the format key to be used for formatting values
- */
- virtual ::sal_Int32 getFormatKey() const = 0;
- };
-
- typedef std::shared_ptr< IValueNormalization > PValueNormalization;
- typedef std::unordered_map< OUString, PValueNormalization, OUStringHash > NormalizerCache;
-
-
//= CellValueConversion_Data
-
+ class StandardFormatNormalizer;
struct CellValueConversion_Data
{
+ typedef std::unordered_map< OUString, std::shared_ptr< StandardFormatNormalizer >, OUStringHash > NormalizerCache;
+
Reference< XNumberFormatter > xNumberFormatter;
bool bAttemptedFormatterCreation;
NormalizerCache aNormalizers;
@@ -119,8 +101,20 @@ namespace svt
//= StandardFormatNormalizer
- class StandardFormatNormalizer : public IValueNormalization
+ class StandardFormatNormalizer
{
+ public:
+ /** converts the given <code>Any</code> into a <code>double</code> value to be fed into a number formatter
+ */
+ virtual double convertToDouble( Any const & i_value ) const = 0;
+
+ /** returns the format key to be used for formatting values
+ */
+ sal_Int32 getFormatKey() const
+ {
+ return m_nFormatKey;
+ }
+
protected:
StandardFormatNormalizer( Reference< XNumberFormatter > const & i_formatter, ::sal_Int32 const i_numberFormatType )
:m_nFormatKey( 0 )
@@ -138,10 +132,7 @@ namespace svt
}
}
- virtual ::sal_Int32 getFormatKey() const SAL_OVERRIDE
- {
- return m_nFormatKey;
- }
+ virtual ~StandardFormatNormalizer() {}
private:
::sal_Int32 m_nFormatKey;
@@ -351,9 +342,9 @@ namespace svt
bool lcl_getValueNormalizer( CellValueConversion_Data & io_data, Type const & i_valueType,
- PValueNormalization & o_formatter )
+ std::shared_ptr< StandardFormatNormalizer > & o_formatter )
{
- NormalizerCache::const_iterator pos = io_data.aNormalizers.find( i_valueType.getTypeName() );
+ CellValueConversion_Data::NormalizerCache::const_iterator pos = io_data.aNormalizers.find( i_valueType.getTypeName() );
if ( pos == io_data.aNormalizers.end() )
{
// never encountered this type before
@@ -432,7 +423,7 @@ namespace svt
{
if ( lcl_ensureNumberFormatter( *m_pData ) )
{
- PValueNormalization pNormalizer;
+ std::shared_ptr< StandardFormatNormalizer > pNormalizer;
if ( lcl_getValueNormalizer( *m_pData, i_value.getValueType(), pNormalizer ) )
{
try
commit 77f884064d88224342fecac033423088f8544f99
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 15:16:46 2015 +0200
loplugin:mergeclasses
Change-Id: I14985f98989861d74b3904ab79f3ced5a3d96f73
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index 22ccec0..d8b0425 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -249,7 +249,6 @@ merge slideshow::internal::UserPaintEventHandler with slideshow::internal::Paint
merge slideshow::internal::View with slideshow::internal::UnoView
merge slideshow::internal::ViewRepaintHandler with (anonymous namespace)::SlideShowImpl::SeparateListenerImpl
merge slideshow::internal::ViewUpdate with slideshow::internal::ShapeManagerImpl
-merge store::PageCache with store::PageCache_Impl
merge svgio::svgreader::InfoProvider with svgio::svgreader::SvgNode
merge svl::IUndoManager with SfxUndoManager
merge svl::StyleSheetCallback with (anonymous namespace)::AddStyleSheetCallback
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx
index 1b7243d..db81ae5 100644
--- a/store/source/storcach.cxx
+++ b/store/source/storcach.cxx
@@ -37,69 +37,9 @@
using namespace store;
-// PageCache (non-virtual interface) implementation.
-storeError PageCache::lookupPageAt (PageHolder & rxPage, sal_uInt32 nOffset)
-{
- OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::PageCache::lookupPageAt(): invalid Offset");
- if (nOffset == STORE_PAGE_NULL)
- return store_E_CantSeek;
-
- return lookupPageAt_Impl (rxPage, nOffset);
-}
-
-storeError PageCache::insertPageAt (PageHolder const & rxPage, sal_uInt32 nOffset)
-{
- // [SECURITY:ValInput]
- PageData const * pagedata = rxPage.get();
- OSL_PRECOND(!(pagedata == 0), "store::PageCache::insertPageAt(): invalid Page");
- if (pagedata == 0)
- return store_E_InvalidParameter;
-
- sal_uInt32 const offset = pagedata->location();
- OSL_PRECOND(!(nOffset != offset), "store::PageCache::insertPageAt(): inconsistent Offset");
- if (nOffset != offset)
- return store_E_InvalidParameter;
-
- OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::PageCache::insertPageAt(): invalid Offset");
- if (nOffset == STORE_PAGE_NULL)
- return store_E_CantSeek;
-
- return insertPageAt_Impl (rxPage, nOffset);
-}
-
-storeError PageCache::updatePageAt (PageHolder const & rxPage, sal_uInt32 nOffset)
-{
- // [SECURITY:ValInput]
- PageData const * pagedata = rxPage.get();
- OSL_PRECOND(!(pagedata == 0), "store::PageCache::updatePageAt(): invalid Page");
- if (pagedata == 0)
- return store_E_InvalidParameter;
-
- sal_uInt32 const offset = pagedata->location();
- OSL_PRECOND(!(nOffset != offset), "store::PageCache::updatePageAt(): inconsistent Offset");
- if (nOffset != offset)
- return store_E_InvalidParameter;
-
- OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::PageCache::updatePageAt(): invalid Offset");
- if (nOffset == STORE_PAGE_NULL)
- return store_E_CantSeek;
-
- return updatePageAt_Impl (rxPage, nOffset);
-}
-
-storeError PageCache::removePageAt (sal_uInt32 nOffset)
-{
- OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::PageCache::removePageAt(): invalid Offset");
- if (nOffset == STORE_PAGE_NULL)
- return store_E_CantSeek;
-
- return removePageAt_Impl (nOffset);
-}
-
// Entry
-namespace
-{
+namespace store {
struct Entry
{
// Representation
@@ -119,8 +59,7 @@ struct Entry
// Destruction
~Entry() {}
};
-
-} // namespace
+};
// EntryCache interface
namespace
@@ -219,69 +158,8 @@ static int highbit(sal_Size n)
return k;
}
-//PageCache_Impl implementation
-namespace store
-{
-
-class PageCache_Impl :
- public store::OStoreObject,
- public store::PageCache,
- private boost::noncopyable
-{
- // Representation
- static size_t const theTableSize = 32;
- static_assert(STORE_IMPL_ISP2(theTableSize), "must be the case");
- Entry ** m_hash_table;
- Entry * m_hash_table_0[theTableSize];
- size_t m_hash_size;
- size_t m_hash_shift;
- size_t const m_page_shift;
-
- size_t m_hash_entries; // total number of entries in table.
- size_t m_nHit;
- size_t m_nMissed;
-
- static inline int hash_Impl(sal_uInt32 a, size_t s, size_t q, size_t m)
- {
- return static_cast<int>((((a) + ((a) >> (s)) + ((a) >> ((s) << 1))) >> (q)) & (m));
- }
- inline int hash_index_Impl (sal_uInt32 nOffset)
- {
- return hash_Impl(nOffset, m_hash_shift, m_page_shift, m_hash_size - 1);
- }
-
- Entry * lookup_Impl (Entry * entry, sal_uInt32 nOffset);
- void rescale_Impl (sal_Size new_size);
-
- // PageCache Implementation
- virtual storeError lookupPageAt_Impl (
- PageHolder & rxPage,
- sal_uInt32 nOffset) SAL_OVERRIDE;
-
- virtual storeError insertPageAt_Impl (
- PageHolder const & rxPage,
- sal_uInt32 nOffset) SAL_OVERRIDE;
-
- virtual storeError updatePageAt_Impl (
- PageHolder const & rxPage,
- sal_uInt32 nOffset) SAL_OVERRIDE;
-
- virtual storeError removePageAt_Impl (
- sal_uInt32 nOffset) SAL_OVERRIDE;
-
-public:
- // Construction
- explicit PageCache_Impl (sal_uInt16 nPageSize);
-
-protected:
- // Destruction
- virtual ~PageCache_Impl();
-};
-
-} // namespace store
-
-PageCache_Impl::PageCache_Impl (sal_uInt16 nPageSize)
+PageCache::PageCache (sal_uInt16 nPageSize)
: m_hash_table (m_hash_table_0),
m_hash_size (theTableSize),
m_hash_shift (highbit(m_hash_size) - 1),
@@ -295,7 +173,7 @@ PageCache_Impl::PageCache_Impl (sal_uInt16 nPageSize)
memset(m_hash_table_0, 0, sizeof(m_hash_table_0));
}
-PageCache_Impl::~PageCache_Impl()
+PageCache::~PageCache()
{
double s_x = 0.0;
sal_Size i, n = m_hash_size;
@@ -326,7 +204,7 @@ PageCache_Impl::~PageCache_Impl()
OSL_TRACE("Hits: %zu, Misses: %zu", m_nHit, m_nMissed);
}
-void PageCache_Impl::rescale_Impl (sal_Size new_size)
+void PageCache::rescale_Impl (sal_Size new_size)
{
sal_Size new_bytes = new_size * sizeof(Entry*);
Entry ** new_table = static_cast<Entry**>(rtl_allocateMemory(new_bytes));
@@ -369,7 +247,7 @@ void PageCache_Impl::rescale_Impl (sal_Size new_size)
}
}
-Entry * PageCache_Impl::lookup_Impl (Entry * entry, sal_uInt32 nOffset)
+Entry * PageCache::lookup_Impl (Entry * entry, sal_uInt32 nOffset)
{
int lookups = 0;
while (entry != 0)
@@ -391,10 +269,12 @@ Entry * PageCache_Impl::lookup_Impl (Entry * entry, sal_uInt32 nOffset)
return entry;
}
-storeError PageCache_Impl::lookupPageAt_Impl (
- PageHolder & rxPage,
- sal_uInt32 nOffset)
+storeError PageCache::lookupPageAt (PageHolder & rxPage, sal_uInt32 nOffset)
{
+ OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::PageCache::lookupPageAt(): invalid Offset");
+ if (nOffset == STORE_PAGE_NULL)
+ return store_E_CantSeek;
+
int index = hash_index_Impl(nOffset);
Entry const * entry = lookup_Impl (m_hash_table[index], nOffset);
if (entry != 0)
@@ -412,10 +292,23 @@ storeError PageCache_Impl::lookupPageAt_Impl (
return store_E_NotExists;
}
-storeError PageCache_Impl::insertPageAt_Impl (
- PageHolder const & rxPage,
- sal_uInt32 nOffset)
+storeError PageCache::insertPageAt (PageHolder const & rxPage, sal_uInt32 nOffset)
{
+ // [SECURITY:ValInput]
+ PageData const * pagedata = rxPage.get();
+ OSL_PRECOND(!(pagedata == 0), "store::PageCache::insertPageAt(): invalid Page");
+ if (pagedata == 0)
+ return store_E_InvalidParameter;
+
+ sal_uInt32 const offset = pagedata->location();
+ OSL_PRECOND(!(nOffset != offset), "store::PageCache::insertPageAt(): inconsistent Offset");
+ if (nOffset != offset)
+ return store_E_InvalidParameter;
+
+ OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::PageCache::insertPageAt(): invalid Offset");
+ if (nOffset == STORE_PAGE_NULL)
+ return store_E_CantSeek;
+
Entry * entry = EntryCache::get().create (rxPage, nOffset);
if (entry != 0)
{
@@ -430,10 +323,23 @@ storeError PageCache_Impl::insertPageAt_Impl (
return store_E_OutOfMemory;
}
-storeError PageCache_Impl::updatePageAt_Impl (
- PageHolder const & rxPage,
- sal_uInt32 nOffset)
+storeError PageCache::updatePageAt (PageHolder const & rxPage, sal_uInt32 nOffset)
{
+ // [SECURITY:ValInput]
+ PageData const * pagedata = rxPage.get();
+ OSL_PRECOND(!(pagedata == 0), "store::PageCache::updatePageAt(): invalid Page");
+ if (pagedata == 0)
+ return store_E_InvalidParameter;
+
+ sal_uInt32 const offset = pagedata->location();
+ OSL_PRECOND(!(nOffset != offset), "store::PageCache::updatePageAt(): inconsistent Offset");
+ if (nOffset != offset)
+ return store_E_InvalidParameter;
+
+ OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::PageCache::updatePageAt(): invalid Offset");
+ if (nOffset == STORE_PAGE_NULL)
+ return store_E_CantSeek;
+
int index = hash_index_Impl(nOffset);
Entry * entry = lookup_Impl (m_hash_table[index], nOffset);
if (entry != 0)
@@ -444,12 +350,15 @@ storeError PageCache_Impl::updatePageAt_Impl (
// Update stats and leave. // m_nUpdHit += 1;
return store_E_None;
}
- return insertPageAt_Impl (rxPage, nOffset);
+ return insertPageAt (rxPage, nOffset);
}
-storeError PageCache_Impl::removePageAt_Impl (
- sal_uInt32 nOffset)
+storeError PageCache::removePageAt (sal_uInt32 nOffset)
{
+ OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::PageCache::removePageAt(): invalid Offset");
+ if (nOffset == STORE_PAGE_NULL)
+ return store_E_CantSeek;
+
Entry ** ppEntry = &(m_hash_table[hash_index_Impl(nOffset)]);
while (*ppEntry != 0)
{
@@ -492,7 +401,7 @@ PageCache_createInstance (
rtl::Reference< store::PageCache > & rxCache,
sal_uInt16 nPageSize)
{
- rxCache = new PageCache_Impl (nPageSize);
+ rxCache = new PageCache (nPageSize);
if (!rxCache.is())
return store_E_OutOfMemory;
diff --git a/store/source/storcach.hxx b/store/source/storcach.hxx
index 511fbba..446d39c 100644
--- a/store/source/storcach.hxx
+++ b/store/source/storcach.hxx
@@ -25,19 +25,54 @@
#include "store/types.h"
#include "storbase.hxx"
+#include "object.hxx"
+#include "boost/noncopyable.hpp"
namespace store
{
+struct Entry;
+
/*========================================================================
*
* PageCache interface.
*
*======================================================================*/
-class PageCache : public virtual salhelper::SimpleReferenceObject
+class PageCache :
+ public store::OStoreObject,
+ private boost::noncopyable
{
+ // Representation
+ static size_t const theTableSize = 32;
+ static_assert(STORE_IMPL_ISP2(theTableSize), "must be the case");
+
+ Entry ** m_hash_table;
+ Entry * m_hash_table_0[theTableSize];
+ size_t m_hash_size;
+ size_t m_hash_shift;
+ size_t const m_page_shift;
+
+ size_t m_hash_entries; // total number of entries in table.
+ size_t m_nHit;
+ size_t m_nMissed;
+
+ static inline int hash_Impl(sal_uInt32 a, size_t s, size_t q, size_t m)
+ {
+ return static_cast<int>((((a) + ((a) >> (s)) + ((a) >> ((s) << 1))) >> (q)) & (m));
+ }
+ inline int hash_index_Impl (sal_uInt32 nOffset)
+ {
+ return hash_Impl(nOffset, m_hash_shift, m_page_shift, m_hash_size - 1);
+ }
+
+ Entry * lookup_Impl (Entry * entry, sal_uInt32 nOffset);
+ void rescale_Impl (sal_Size new_size);
+
public:
+ // Construction
+ explicit PageCache (sal_uInt16 nPageSize);
+
/** load.
*/
storeError lookupPageAt (
@@ -62,25 +97,8 @@ public:
sal_uInt32 nOffset);
protected:
- virtual ~PageCache() {}
-
-private:
- /** Implementation (abstract).
- */
- virtual storeError lookupPageAt_Impl (
- PageHolder & rxPage,
- sal_uInt32 nOffset) = 0;
-
- virtual storeError insertPageAt_Impl (
- PageHolder const & rxPage,
- sal_uInt32 nOffset) = 0;
-
- virtual storeError updatePageAt_Impl (
- PageHolder const & rxPage,
- sal_uInt32 nOffset) = 0;
-
- virtual storeError removePageAt_Impl (
- sal_uInt32 nOffset) = 0;
+ // Destruction
+ virtual ~PageCache();
};
/*========================================================================
commit 44a46d4f3bc2852851f092b168e4b84d37719ca9
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 15:07:04 2015 +0200
loplugin:mergeclasses
Change-Id: I28d8bd79f266df7e9ea420f7238ed332ec4205a9
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index eb2789b..22ccec0 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -249,7 +249,6 @@ merge slideshow::internal::UserPaintEventHandler with slideshow::internal::Paint
merge slideshow::internal::View with slideshow::internal::UnoView
merge slideshow::internal::ViewRepaintHandler with (anonymous namespace)::SlideShowImpl::SeparateListenerImpl
merge slideshow::internal::ViewUpdate with slideshow::internal::ShapeManagerImpl
-merge store::IStoreHandle with store::OStoreObject
merge store::PageCache with store::PageCache_Impl
merge svgio::svgreader::InfoProvider with svgio::svgreader::SvgNode
merge svl::IUndoManager with SfxUndoManager
diff --git a/store/source/object.hxx b/store/source/object.hxx
index 40bc287..b44d83b 100644
--- a/store/source/object.hxx
+++ b/store/source/object.hxx
@@ -29,46 +29,19 @@ namespace store
/*========================================================================
*
- * IStoreHandle interface.
- *
- *======================================================================*/
-class IStoreHandle : public virtual salhelper::SimpleReferenceObject
-{
-public:
- /** Replaces dynamic_cast type checking.
- */
- virtual bool isKindOf (sal_uInt32 nTypeId) = 0;
-
-protected:
- virtual ~IStoreHandle() {}
-};
-
-/** Template helper function as dynamic_cast replacement.
- */
-template<class store_handle_type>
-store_handle_type * SAL_CALL query (
- IStoreHandle * pHandle, store_handle_type *);
-
-/*========================================================================
- *
* OStoreObject interface.
*
*======================================================================*/
-class OStoreObject : public store::IStoreHandle
+class OStoreObject : public virtual salhelper::SimpleReferenceObject
{
- /** Template function specialization as dynamic_cast replacement.
- */
- friend OStoreObject*
- SAL_CALL query<> (IStoreHandle *pHandle, OStoreObject*);
-
public:
/** Construction.
*/
OStoreObject() {}
- /** IStoreHandle.
+ /** Replaces dynamic_cast type checking.
*/
- virtual bool isKindOf (sal_uInt32 nTypeId) SAL_OVERRIDE;
+ virtual bool isKindOf (sal_uInt32 nTypeId);
protected:
/** Destruction.
@@ -83,18 +56,11 @@ private:
OStoreObject& operator= (const OStoreObject&) SAL_DELETED_FUNCTION;
};
-/** Template function specialization as dynamic_cast replacement.
+/** Template helper function as dynamic_cast replacement.
*/
-template<> inline OStoreObject*
-SAL_CALL query (IStoreHandle *pHandle, OStoreObject*)
-{
- if (pHandle && pHandle->isKindOf (OStoreObject::m_nTypeId))
- {
- // Handle is kind of OStoreObject.
- return static_cast<OStoreObject*>(pHandle);
- }
- return 0;
-}
+template<class store_handle_type>
+store_handle_type * SAL_CALL query (
+ OStoreObject * pHandle, store_handle_type *);
/*========================================================================
*
diff --git a/store/source/stordir.hxx b/store/source/stordir.hxx
index 8fb9de7..43ba3dc 100644
--- a/store/source/stordir.hxx
+++ b/store/source/stordir.hxx
@@ -85,7 +85,7 @@ private:
/** IStoreHandle query() template function specialization.
*/
friend OStoreDirectory_Impl*
- SAL_CALL query<> (IStoreHandle *pHandle, OStoreDirectory_Impl*);
+ SAL_CALL query<> (OStoreObject *pHandle, OStoreDirectory_Impl*);
/** Representation.
*/
@@ -103,7 +103,7 @@ private:
};
template<> inline OStoreDirectory_Impl*
-SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl*)
+SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl*)
{
if (pHandle && pHandle->isKindOf (OStoreDirectory_Impl::m_nTypeId))
{
diff --git a/store/source/store.cxx b/store/source/store.cxx
index c6e79a8..1b5107f 100644
--- a/store/source/store.cxx
+++ b/store/source/store.cxx
@@ -48,7 +48,7 @@ public:
static store_handle_type * SAL_CALL query (void * pHandle)
{
return store::query (
- static_cast<IStoreHandle*>(pHandle),
+ static_cast<OStoreObject*>(pHandle),
static_cast<store_handle_type*>(0));
}
};
@@ -68,7 +68,7 @@ storeError SAL_CALL store_acquireHandle (
storeHandle Handle
) SAL_THROW_EXTERN_C()
{
- IStoreHandle *pHandle = static_cast<IStoreHandle*>(Handle);
+ OStoreObject *pHandle = static_cast<OStoreObject*>(Handle);
if (!pHandle)
return store_E_InvalidHandle;
@@ -83,7 +83,7 @@ storeError SAL_CALL store_releaseHandle (
storeHandle Handle
) SAL_THROW_EXTERN_C()
{
- IStoreHandle *pHandle = static_cast<IStoreHandle*>(Handle);
+ OStoreObject *pHandle = static_cast<OStoreObject*>(Handle);
if (!pHandle)
return store_E_InvalidHandle;
diff --git a/store/source/storlckb.hxx b/store/source/storlckb.hxx
index 67c4a14..4fffb47 100644
--- a/store/source/storlckb.hxx
+++ b/store/source/storlckb.hxx
@@ -120,7 +120,7 @@ private:
/** IStoreHandle query() template specialization.
*/
friend OStoreLockBytes*
- SAL_CALL query<> (IStoreHandle *pHandle, OStoreLockBytes*);
+ SAL_CALL query<> (OStoreObject *pHandle, OStoreLockBytes*);
/** Representation.
*/
@@ -139,7 +139,7 @@ private:
};
template<> inline OStoreLockBytes*
-SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStoreLockBytes*)
+SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStoreLockBytes*)
{
if (pHandle && pHandle->isKindOf (OStoreLockBytes::m_nTypeId))
{
diff --git a/store/source/storpage.hxx b/store/source/storpage.hxx
index f400a3f..f57d720 100644
--- a/store/source/storpage.hxx
+++ b/store/source/storpage.hxx
@@ -157,7 +157,7 @@ private:
/** IStoreHandle query() template function specialization.
*/
friend OStorePageManager*
- SAL_CALL query<> (IStoreHandle *pHandle, OStorePageManager*);
+ SAL_CALL query<> (OStoreObject *pHandle, OStorePageManager*);
/** Representation.
*/
@@ -194,7 +194,7 @@ inline bool OStorePageManager::isValid() const
}
template<> inline OStorePageManager*
-SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStorePageManager*)
+SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStorePageManager*)
{
if (pHandle && pHandle->isKindOf (OStorePageManager::m_nTypeId))
{
commit dee4645edca450c91139bb2a829bc995269de6ad
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 14:57:03 2015 +0200
loplugin:mergeclasses
Change-Id: I9b926e59b2df62c22fb5ecfc7c16d8047b6da2a4
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index dc4a349..eb2789b 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -179,7 +179,6 @@ merge helpdatafileproxy::hdf_internal::Noncopyable with helpdatafileproxy::Hdf
merge i_xml_parser_event_handler with (anonymous namespace)::recently_used_file_filter
merge io_stm::IRingBuffer with io_stm::MemRingBuffer
merge io_stm::I_FIFO with io_stm::MemFIFO
-merge linguistic::Flushable with linguistic::SpellCache
merge oglcanvas::CanvasHelper with oglcanvas::BitmapCanvasHelper
merge oglcanvas::IBufferContext with oglcanvas::(anonymous namespace)::BufferContextImpl
merge ooo::vba::XHelperInterface with ooo::vba::msforms::XShape
diff --git a/linguistic/inc/iprcache.hxx b/linguistic/inc/iprcache.hxx
index 5e56a13..0950554 100644
--- a/linguistic/inc/iprcache.hxx
+++ b/linguistic/inc/iprcache.hxx
@@ -39,16 +39,7 @@
namespace linguistic
{
-
-class Flushable
-{
-public:
- virtual void Flush() = 0;
-
-protected:
- ~Flushable() {}
-};
-
+class SpellCache;
class FlushListener :
public cppu::WeakImplHelper
@@ -57,20 +48,16 @@ class FlushListener :
::com::sun::star::beans::XPropertyChangeListener
>
{
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XLinguProperties > xPropSet;
- Flushable *pFlushObj;
+ css::uno::Reference< css::linguistic2::XSearchableDictionaryList > xDicList;
+ css::uno::Reference< css::linguistic2::XLinguProperties > xPropSet;
+ SpellCache& mrSpellCache;
FlushListener(const FlushListener &) SAL_DELETED_FUNCTION;
FlushListener & operator = (const FlushListener &) SAL_DELETED_FUNCTION;
public:
- FlushListener( Flushable *pFO );
- virtual ~FlushListener();
-
- inline void SetFlushObj( Flushable *pFO) { pFlushObj = pFO; }
+ FlushListener( SpellCache& rFO ) : mrSpellCache(rFO) {}
+ virtual ~FlushListener() {}
void SetDicList( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > &rDL );
void SetPropSet( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguProperties > &rPS );
@@ -86,8 +73,7 @@ public:
};
-class SpellCache :
- public Flushable
+class SpellCache
{
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XDictionaryListEventListener >
@@ -105,8 +91,8 @@ public:
SpellCache();
virtual ~SpellCache();
- // Flushable
- virtual void Flush() SAL_OVERRIDE;
+ // called from FlushListener
+ void Flush();
void AddWord( const OUString& rWord, LanguageType nLang );
bool CheckWord( const OUString& rWord, LanguageType nLang );
diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx
index cb68a3b..5c4b98a 100644
--- a/linguistic/source/iprcache.cxx
+++ b/linguistic/source/iprcache.cxx
@@ -99,17 +99,6 @@ static bool lcl_IsFlushProperty( sal_Int32 nHandle )
}
-FlushListener::FlushListener( Flushable *pFO )
-{
- SetFlushObj( pFO );
-}
-
-
-FlushListener::~FlushListener()
-{
-}
-
-
void FlushListener::SetDicList( Reference<XSearchableDictionaryList> &rDL )
{
MutexGuard aGuard( GetLinguMutex() );
@@ -176,9 +165,8 @@ void SAL_CALL FlushListener::processDictionaryListEvent(
DictionaryListEventFlags::DEACTIVATE_POS_DIC;
bool bFlush = 0 != (nEvt & nFlushFlags);
- DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" );
- if (bFlush && pFlushObj != NULL)
- pFlushObj->Flush();
+ if (bFlush)
+ mrSpellCache.Flush();
}
}
@@ -193,9 +181,8 @@ void SAL_CALL FlushListener::propertyChange(
{
bool bFlush = lcl_IsFlushProperty( rEvt.PropertyHandle );
- DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" );
- if (bFlush && pFlushObj != NULL)
- pFlushObj->Flush();
+ if (bFlush)
+ mrSpellCache.Flush();
}
}
@@ -203,7 +190,7 @@ void SAL_CALL FlushListener::propertyChange(
SpellCache::SpellCache()
{
- pFlushLstnr = new FlushListener( this );
+ pFlushLstnr = new FlushListener( *this );
xFlushLstnr = pFlushLstnr;
Reference<XSearchableDictionaryList> aDictionaryList(GetDictionaryList());
pFlushLstnr->SetDicList( aDictionaryList ); //! after reference is established
commit dff288c6ee45e027375ad3d7f3ea392df26f3aa0
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 14:50:13 2015 +0200
loplugin:mergedclasses
Change-Id: I3eb2de4edcd4b2d757d1e0916e7c903b5d6c569e
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index 0bb4259..dc4a349 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -163,7 +163,6 @@ merge dbp::OModuleResourceClient with dbp::OUnoAutoPilot
merge dbtools::ISQLStatementHelper with connectivity::mysql::OTables
merge formula::ExternalReferenceHelper with ScExternalRefManager
merge formula::IStructHelper with formula::StructPage
-merge framework::IStorageListener with framework::XMLBasedAcceleratorConfiguration
merge frm::IAttributeHandler with frm::AttributeHandler
merge frm::ICommandDescriptionProvider with frm::DefaultCommandDescriptionProvider
merge frm::ICommandImageProvider with frm::DocumentCommandImageProvider
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index 59c6a93..74ea13f 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -387,7 +387,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::removeResetListener(const css::u
}
// IStorageListener
-void XMLBasedAcceleratorConfiguration::changesOccurred(const OUString& /*sPath*/)
+void XMLBasedAcceleratorConfiguration::changesOccurred()
{
reload();
}
diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx
index f69cc42..784cf58 100644
--- a/framework/source/accelerators/documentacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx
@@ -18,7 +18,6 @@
*/
#include <accelerators/acceleratorconfiguration.hxx>
-#include <accelerators/istoragelistener.hxx>
#include <accelerators/presethandler.hxx>
#include <xml/acceleratorconfigurationreader.hxx>
diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx
index 0b23294..54ee973 100644
--- a/framework/source/accelerators/presethandler.cxx
+++ b/framework/source/accelerators/presethandler.cxx
@@ -632,7 +632,7 @@ void PresetHandler::commitUserChanges()
}
}
-void PresetHandler::addStorageListener(IStorageListener* pListener)
+void PresetHandler::addStorageListener(XMLBasedAcceleratorConfiguration* pListener)
{
OUString sRelPath;
EConfigType eCfgType;
@@ -662,7 +662,7 @@ void PresetHandler::addStorageListener(IStorageListener* pListener)
}
}
-void PresetHandler::removeStorageListener(IStorageListener* pListener)
+void PresetHandler::removeStorageListener(XMLBasedAcceleratorConfiguration* pListener)
{
OUString sRelPath;
EConfigType eCfgType;
diff --git a/framework/source/accelerators/storageholder.cxx b/framework/source/accelerators/storageholder.cxx
index 0dd139b..104b66f 100644
--- a/framework/source/accelerators/storageholder.cxx
+++ b/framework/source/accelerators/storageholder.cxx
@@ -18,6 +18,7 @@
*/
#include <accelerators/storageholder.hxx>
+#include <accelerators/acceleratorconfiguration.hxx>
#include <services.h>
@@ -284,13 +285,13 @@ void StorageHolder::notifyPath(const OUString& sPath)
pIt2 != rInfo.Listener.end();
++pIt2 )
{
- IStorageListener* pListener = *pIt2;
+ XMLBasedAcceleratorConfiguration* pListener = *pIt2;
if (pListener)
- pListener->changesOccurred(sNormedPath);
+ pListener->changesOccurred();
}
}
-void StorageHolder::addStorageListener( IStorageListener* pListener,
+void StorageHolder::addStorageListener( XMLBasedAcceleratorConfiguration* pListener,
const OUString& sPath )
{
OUString sNormedPath = StorageHolder::impl_st_normPath(sPath);
@@ -307,7 +308,7 @@ void StorageHolder::addStorageListener( IStorageListener* pListener,
rInfo.Listener.push_back(pListener);
}
-void StorageHolder::removeStorageListener( IStorageListener* pListener,
+void StorageHolder::removeStorageListener( XMLBasedAcceleratorConfiguration* pListener,
const OUString& sPath )
{
OUString sNormedPath = StorageHolder::impl_st_normPath(sPath);
diff --git a/framework/source/inc/accelerators/acceleratorconfiguration.hxx b/framework/source/inc/accelerators/acceleratorconfiguration.hxx
index b423f4b..cf120ba 100644
--- a/framework/source/inc/accelerators/acceleratorconfiguration.hxx
+++ b/framework/source/inc/accelerators/acceleratorconfiguration.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ACCELERATORCONFIGURATION_HXX
#define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ACCELERATORCONFIGURATION_HXX
-#include <accelerators/istoragelistener.hxx>
#include <accelerators/presethandler.hxx>
#include <accelerators/acceleratorcache.hxx>
#include <accelerators/keymapping.hxx>
@@ -61,8 +60,7 @@ const char CFG_ENTRY_MODULES[] = "Modules";
/**
implements a read/write access to the accelerator configuration.
*/
-class XMLBasedAcceleratorConfiguration : public IStorageListener,
- public ::cppu::WeakImplHelper<
+class XMLBasedAcceleratorConfiguration : public ::cppu::WeakImplHelper<
css::form::XReset, // TODO use XPresetHandler instead if available
css::ui::XAcceleratorConfiguration > // => css::ui::XUIConfigurationPersistence
// css::ui::XUIConfigurationStorage
@@ -176,8 +174,8 @@ class XMLBasedAcceleratorConfiguration : public IStorageListener,
virtual void SAL_CALL removeResetListener(const css::uno::Reference< css::form::XResetListener >& xListener)
throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- // IStorageListener
- virtual void changesOccurred(const OUString& sPath) SAL_OVERRIDE;
+ // called when changes occurred in the storage
+ void changesOccurred();
// helper for derived classes
diff --git a/framework/source/inc/accelerators/istoragelistener.hxx b/framework/source/inc/accelerators/istoragelistener.hxx
deleted file mode 100644
index b6786dc..0000000
--- a/framework/source/inc/accelerators/istoragelistener.hxx
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ISTORAGELISTENER_HXX
-#define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ISTORAGELISTENER_HXX
-
-#include <general.h>
-#include <stdtypes.h>
-
-// definition
-
-namespace framework
-{
-
-/**
- TODO document me
- */
-class IStorageListener
-{
- public:
-
- /** @short TODO */
- virtual void changesOccurred(const OUString& sPath) = 0;
-
- protected:
- ~IStorageListener() {}
-};
-
-} // namespace framework
-
-#endif // INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ISTORAGELISTENER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/inc/accelerators/presethandler.hxx b/framework/source/inc/accelerators/presethandler.hxx
index a692f4d..6ea5cd4 100644
--- a/framework/source/inc/accelerators/presethandler.hxx
+++ b/framework/source/inc/accelerators/presethandler.hxx
@@ -355,8 +355,8 @@ class PresetHandler
void commitUserChanges();
/** TODO */
- void addStorageListener(IStorageListener* pListener);
- void removeStorageListener(IStorageListener* pListener);
+ void addStorageListener(XMLBasedAcceleratorConfiguration* pListener);
+ void removeStorageListener(XMLBasedAcceleratorConfiguration* pListener);
// helper
diff --git a/framework/source/inc/accelerators/storageholder.hxx b/framework/source/inc/accelerators/storageholder.hxx
index fcef476..54e75cd 100644
--- a/framework/source/inc/accelerators/storageholder.hxx
+++ b/framework/source/inc/accelerators/storageholder.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_STORAGEHOLDER_HXX
#define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_STORAGEHOLDER_HXX
-#include <accelerators/istoragelistener.hxx>
#include <general.h>
#include <stdtypes.h>
@@ -29,6 +28,7 @@
namespace framework
{
+class XMLBasedAcceleratorConfiguration;
/**
TODO document me
*/
@@ -41,7 +41,7 @@ class StorageHolder
/** @short TODO */
typedef ::std::vector< css::uno::Reference< css::embed::XStorage > > TStorageList;
- typedef ::std::vector< IStorageListener* > TStorageListenerList;
+ typedef ::std::vector< XMLBasedAcceleratorConfiguration* > TStorageListenerList;
struct TStorageInfo
{
@@ -118,12 +118,12 @@ class StorageHolder
/** @short TODO
*/
- void addStorageListener( IStorageListener* pListener,
+ void addStorageListener( XMLBasedAcceleratorConfiguration* pListener,
const OUString& sPath );
/** @short TODO
*/
- void removeStorageListener( IStorageListener* pListener,
+ void removeStorageListener( XMLBasedAcceleratorConfiguration* pListener,
const OUString& sPath );
/** @short TODO
commit b700e3426ecbeadf1c8f5fad590101354706e227
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 14:35:38 2015 +0200
loplugin:mergeclasses
Change-Id: I131d192a0029ec3eebacb72341ba3113de0e19ac
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index e00a7a6..0bb4259 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -163,7 +163,6 @@ merge dbp::OModuleResourceClient with dbp::OUnoAutoPilot
merge dbtools::ISQLStatementHelper with connectivity::mysql::OTables
merge formula::ExternalReferenceHelper with ScExternalRefManager
merge formula::IStructHelper with formula::StructPage
-merge framework::ISpinfieldListener with framework::SpinfieldToolbarController
merge framework::IStorageListener with framework::XMLBasedAcceleratorConfiguration
merge frm::IAttributeHandler with frm::AttributeHandler
merge frm::ICommandDescriptionProvider with frm::DefaultCommandDescriptionProvider
diff --git a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
index b2f5efe..a09663a 100644
--- a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
+++ b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
@@ -35,26 +35,7 @@ namespace framework
class SpinfieldControl;
-class ISpinfieldListener
-{
- public:
- virtual void Up() = 0;
- virtual void Down() = 0;
- virtual void First() = 0;
- virtual void Last() = 0;
- virtual void KeyInput( const KeyEvent& rKEvt ) = 0;
- virtual void Modify() = 0;
- virtual void GetFocus() = 0;
- virtual void StateChanged( StateChangedType nType ) = 0;
- virtual void DataChanged( const DataChangedEvent& rDCEvt ) = 0;
- virtual bool PreNotify( NotifyEvent& rNEvt ) = 0;
-
- protected:
- ~ISpinfieldListener() {}
-};
-
-class SpinfieldToolbarController : public ISpinfieldListener,
- public ComplexToolbarController
+class SpinfieldToolbarController : public ComplexToolbarController
{
public:
@@ -69,17 +50,17 @@ class SpinfieldToolbarController : public ISpinfieldListener,
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
- // ISpinfieldListener
- virtual void Up() SAL_OVERRIDE;
- virtual void Down() SAL_OVERRIDE;
- virtual void First() SAL_OVERRIDE;
- virtual void Last() SAL_OVERRIDE;
- virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
- virtual void Modify() SAL_OVERRIDE;
- virtual void GetFocus() SAL_OVERRIDE;
- virtual void StateChanged( StateChangedType nType ) SAL_OVERRIDE;
- virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
- virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
+ // called from SpinfieldControl
+ void Up();
+ void Down();
+ void First();
+ void Last();
+ void KeyInput( const KeyEvent& rKEvt );
+ void Modify();
+ void GetFocus();
+ void StateChanged( StateChangedType nType );
+ void DataChanged( const DataChangedEvent& rDCEvt );
+ bool PreNotify( NotifyEvent& rNEvt );
protected:
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ) SAL_OVERRIDE;
diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
index 21c2d57..747c629 100644
--- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx
+++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
@@ -56,7 +56,7 @@ namespace framework
class SpinfieldControl : public SpinField
{
public:
- SpinfieldControl( vcl::Window* pParent, WinBits nStyle, ISpinfieldListener* pSpinFieldListener );
+ SpinfieldControl( vcl::Window* pParent, WinBits nStyle, SpinfieldToolbarController* pSpinfieldToolbarController );
virtual ~SpinfieldControl();
virtual void dispose() SAL_OVERRIDE;
@@ -73,12 +73,12 @@ class SpinfieldControl : public SpinField
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
private:
- ISpinfieldListener* m_pSpinFieldListener;
+ SpinfieldToolbarController* m_pSpinfieldToolbarController;
};
-SpinfieldControl::SpinfieldControl( vcl::Window* pParent, WinBits nStyle, ISpinfieldListener* pSpinFieldListener ) :
+SpinfieldControl::SpinfieldControl( vcl::Window* pParent, WinBits nStyle, SpinfieldToolbarController* pSpinfieldToolbarController ) :
SpinField( pParent, nStyle )
- , m_pSpinFieldListener( pSpinFieldListener )
+ , m_pSpinfieldToolbarController( pSpinfieldToolbarController )
{
}
@@ -89,85 +89,85 @@ SpinfieldControl::~SpinfieldControl()
void SpinfieldControl::dispose()
{
- m_pSpinFieldListener = 0;
+ m_pSpinfieldToolbarController = 0;
SpinField::dispose();
}
void SpinfieldControl::Up()
{
SpinField::Up();
- if ( m_pSpinFieldListener )
- m_pSpinFieldListener->Up();
+ if ( m_pSpinfieldToolbarController )
+ m_pSpinfieldToolbarController->Up();
}
void SpinfieldControl::Down()
{
SpinField::Down();
- if ( m_pSpinFieldListener )
- m_pSpinFieldListener->Down();
+ if ( m_pSpinfieldToolbarController )
+ m_pSpinfieldToolbarController->Down();
}
void SpinfieldControl::First()
{
SpinField::First();
- if ( m_pSpinFieldListener )
- m_pSpinFieldListener->First();
+ if ( m_pSpinfieldToolbarController )
+ m_pSpinfieldToolbarController->First();
}
void SpinfieldControl::Last()
{
SpinField::First();
- if ( m_pSpinFieldListener )
- m_pSpinFieldListener->Last();
+ if ( m_pSpinfieldToolbarController )
+ m_pSpinfieldToolbarController->Last();
}
void SpinfieldControl::KeyInput( const ::KeyEvent& rKEvt )
{
SpinField::KeyInput( rKEvt );
- if ( m_pSpinFieldListener )
- m_pSpinFieldListener->KeyInput( rKEvt );
+ if ( m_pSpinfieldToolbarController )
+ m_pSpinfieldToolbarController->KeyInput( rKEvt );
}
void SpinfieldControl::Modify()
{
SpinField::Modify();
- if ( m_pSpinFieldListener )
- m_pSpinFieldListener->Modify();
+ if ( m_pSpinfieldToolbarController )
+ m_pSpinfieldToolbarController->Modify();
}
void SpinfieldControl::GetFocus()
{
SpinField::GetFocus();
- if ( m_pSpinFieldListener )
- m_pSpinFieldListener->GetFocus();
+ if ( m_pSpinfieldToolbarController )
+ m_pSpinfieldToolbarController->GetFocus();
}
void SpinfieldControl::LoseFocus()
{
SpinField::GetFocus();
- if ( m_pSpinFieldListener )
- m_pSpinFieldListener->GetFocus();
+ if ( m_pSpinfieldToolbarController )
+ m_pSpinfieldToolbarController->GetFocus();
}
void SpinfieldControl::StateChanged( StateChangedType nType )
{
SpinField::StateChanged( nType );
- if ( m_pSpinFieldListener )
- m_pSpinFieldListener->StateChanged( nType );
+ if ( m_pSpinfieldToolbarController )
+ m_pSpinfieldToolbarController->StateChanged( nType );
}
void SpinfieldControl::DataChanged( const DataChangedEvent& rDCEvt )
{
SpinField::DataChanged( rDCEvt );
- if ( m_pSpinFieldListener )
- m_pSpinFieldListener->DataChanged( rDCEvt );
+ if ( m_pSpinfieldToolbarController )
+ m_pSpinfieldToolbarController->DataChanged( rDCEvt );
}
bool SpinfieldControl::PreNotify( NotifyEvent& rNEvt )
{
bool bRet = false;
- if ( m_pSpinFieldListener )
- bRet = m_pSpinFieldListener->PreNotify( rNEvt );
+ if ( m_pSpinfieldToolbarController )
+ bRet = m_pSpinfieldToolbarController->PreNotify( rNEvt );
if ( !bRet )
bRet = SpinField::PreNotify( rNEvt );
commit 3fbc3adefd0b2140ff7697cbc3d4b71ed92aa5ff
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 14:33:28 2015 +0200
loplugin:mergeclasses
Change-Id: I1347e51ef727da81be0c7937cad6e3f5edbf15a8
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index f64322c..e00a7a6 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -163,7 +163,6 @@ merge dbp::OModuleResourceClient with dbp::OUnoAutoPilot
merge dbtools::ISQLStatementHelper with connectivity::mysql::OTables
merge formula::ExternalReferenceHelper with ScExternalRefManager
merge formula::IStructHelper with formula::StructPage
-merge framework::IListBoxListener with framework::DropdownToolbarController
merge framework::ISpinfieldListener with framework::SpinfieldToolbarController
merge framework::IStorageListener with framework::XMLBasedAcceleratorConfiguration
merge frm::IAttributeHandler with frm::AttributeHandler
diff --git a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
index 956b53b..eab137d 100644
--- a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
+++ b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
@@ -35,20 +35,7 @@ namespace framework
class ListBoxControl;
-class IListBoxListener
-{
- public:
- virtual void Select() = 0;
- virtual void DoubleClick() = 0;
- virtual void GetFocus() = 0;
- virtual void LoseFocus() = 0;
- virtual bool PreNotify( NotifyEvent& rNEvt ) = 0;
- protected:
- ~IListBoxListener() {}
-};
-
-class DropdownToolbarController : public IListBoxListener,
- public ComplexToolbarController
+class DropdownToolbarController : public ComplexToolbarController
{
public:
@@ -63,12 +50,12 @@ class DropdownToolbarController : public IListBoxListener,
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
- // IListBoxListener
- virtual void Select() SAL_OVERRIDE;
- virtual void DoubleClick() SAL_OVERRIDE;
- virtual void GetFocus() SAL_OVERRIDE;
- virtual void LoseFocus() SAL_OVERRIDE;
- virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
+ // called from ListBoxControl
+ void Select();
+ void DoubleClick();
+ void GetFocus();
+ void LoseFocus();
+ bool PreNotify( NotifyEvent& rNEvt );
protected:
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ) SAL_OVERRIDE;
diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
index 34f0bfe..8a086dd 100644
--- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
@@ -52,7 +52,7 @@ namespace framework
class ListBoxControl : public ListBox
{
public:
- ListBoxControl( vcl::Window* pParent, WinBits nStyle, IListBoxListener* pListBoxListener );
+ ListBoxControl( vcl::Window* pParent, WinBits nStyle, DropdownToolbarController* pListBoxListener );
virtual ~ListBoxControl();
virtual void dispose() SAL_OVERRIDE;
@@ -63,10 +63,10 @@ class ListBoxControl : public ListBox
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
private:
- IListBoxListener* m_pListBoxListener;
+ DropdownToolbarController* m_pListBoxListener;
};
-ListBoxControl::ListBoxControl( vcl::Window* pParent, WinBits nStyle, IListBoxListener* pListBoxListener ) :
+ListBoxControl::ListBoxControl( vcl::Window* pParent, WinBits nStyle, DropdownToolbarController* pListBoxListener ) :
ListBox( pParent, nStyle )
, m_pListBoxListener( pListBoxListener )
{
commit 6fbbb8504a879815547681f7494153d4c1c35783
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 14:31:38 2015 +0200
loplugin:mergeclasses
Change-Id: I45ccf880900f46a121c73152615ec3534a47d750
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index 22678bf..f64322c 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -163,7 +163,6 @@ merge dbp::OModuleResourceClient with dbp::OUnoAutoPilot
merge dbtools::ISQLStatementHelper with connectivity::mysql::OTables
merge formula::ExternalReferenceHelper with ScExternalRefManager
merge formula::IStructHelper with formula::StructPage
-merge framework::ILayoutNotifications with framework::LayoutManager
merge framework::IListBoxListener with framework::DropdownToolbarController
merge framework::ISpinfieldListener with framework::SpinfieldToolbarController
merge framework::IStorageListener with framework::XMLBasedAcceleratorConfiguration
diff --git a/framework/inc/helper/ilayoutnotifications.hxx b/framework/inc/helper/ilayoutnotifications.hxx
deleted file mode 100644
index 0063386..0000000
--- a/framework/inc/helper/ilayoutnotifications.hxx
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_FRAMEWORK_INC_HELPER_ILAYOUTNOTIFICATIONS_HXX
-#define INCLUDED_FRAMEWORK_INC_HELPER_ILAYOUTNOTIFICATIONS_HXX
-
-namespace framework
-{
-
-class ILayoutNotifications
-{
- public:
- enum Hint
- {
- HINT_NOT_SPECIFIED,
- HINT_TOOLBARSPACE_HAS_CHANGED,
- HINT_COUNT
- };
-
- virtual void requestLayout( Hint eHint = HINT_NOT_SPECIFIED ) = 0;
-
- protected:
- ~ILayoutNotifications() {}
-};
-
-}
-
-#endif // INCLUDED_FRAMEWORK_INC_HELPER_ILAYOUTNOTIFICATIONS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index 76d958e..bb018b4 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -27,7 +27,6 @@
#include <uielement/menubarmanager.hxx>
#include <framework/addonsoptions.hxx>
#include <uielement/uielement.hxx>
-#include <helper/ilayoutnotifications.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
@@ -61,6 +60,7 @@
class MenuBar;
namespace framework
{
+
class ToolbarLayoutManager;
class GlobalSettings;
namespace detail
@@ -75,10 +75,15 @@ namespace framework
class LayoutManager : public LayoutManager_Base ,
private cppu::BaseMutex,
public ::cppu::OBroadcastHelper ,
- public ILayoutNotifications ,
public LayoutManager_PBase
{
public:
+ enum Hint
+ {
+ HINT_NOT_SPECIFIED,
+ HINT_TOOLBARSPACE_HAS_CHANGED,
+ HINT_COUNT
+ };
enum { DOCKINGAREAS_COUNT = 4 };
LayoutManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext );
@@ -171,9 +176,8 @@ namespace framework
DECL_LINK_TYPED( MenuBarClose, void *, void);
DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void );
- // ILayoutNotifications
-
- virtual void requestLayout( Hint eHint ) SAL_OVERRIDE;
+ // called from ToolbarLayoutManager
+ void requestLayout( Hint eHint = HINT_NOT_SPECIFIED );
/// Reading of settings - shared with ToolbarLayoutManager.
static bool readWindowStateData( const OUString& rName, UIElement& rElementData,
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index a5bb7ba..56806fe 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -53,7 +53,7 @@ namespace framework
ToolbarLayoutManager::ToolbarLayoutManager(
const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Reference< ui::XUIElementFactory >& xUIElementFactory,
- ILayoutNotifications* pParentLayouter ):
+ LayoutManager* pParentLayouter ):
m_xContext( rxContext),
m_xUIElementFactoryManager( xUIElementFactory ),
m_pParentLayouter( pParentLayouter ),
@@ -980,7 +980,7 @@ long ToolbarLayoutManager::childWindowEvent( VclSimpleEvent* pEvent )
if ( aToolbar.m_xUIElement.is() && !aToolbar.m_bFloating )
{
implts_setLayoutDirty();
- m_pParentLayouter->requestLayout( ILayoutNotifications::HINT_TOOLBARSPACE_HAS_CHANGED );
+ m_pParentLayouter->requestLayout( LayoutManager::HINT_TOOLBARSPACE_HAS_CHANGED );
}
}
}
@@ -3231,7 +3231,7 @@ throw( uno::RuntimeException, std::exception )
}
if ( bNotify )
- m_pParentLayouter->requestLayout( ILayoutNotifications::HINT_TOOLBARSPACE_HAS_CHANGED );
+ m_pParentLayouter->requestLayout( LayoutManager::HINT_TOOLBARSPACE_HAS_CHANGED );
}
}
@@ -3572,7 +3572,7 @@ throw (uno::RuntimeException, std::exception)
aWriteLock.clear();
if ( bNotify )
- m_pParentLayouter->requestLayout( ILayoutNotifications::HINT_TOOLBARSPACE_HAS_CHANGED );
+ m_pParentLayouter->requestLayout( LayoutManager::HINT_TOOLBARSPACE_HAS_CHANGED );
}
sal_Bool SAL_CALL ToolbarLayoutManager::prepareToggleFloatingMode( const lang::EventObject& e )
@@ -3723,11 +3723,11 @@ throw (uno::RuntimeException, std::exception)
implts_setLayoutDirty();
aReadLock.reset();
- ILayoutNotifications* pParentLayouter( m_pParentLayouter );
+ LayoutManager* pParentLayouter( m_pParentLayouter );
aReadLock.clear();
if ( pParentLayouter )
- pParentLayouter->requestLayout( ILayoutNotifications::HINT_TOOLBARSPACE_HAS_CHANGED );
+ pParentLayouter->requestLayout( LayoutManager::HINT_TOOLBARSPACE_HAS_CHANGED );
}
}
else
@@ -3787,11 +3787,11 @@ throw (uno::RuntimeException, std::exception)
SolarMutexClearableGuard aReadLock;
bool bLayoutDirty = m_bLayoutDirty;
- ILayoutNotifications* pParentLayouter( m_pParentLayouter );
+ LayoutManager* pParentLayouter( m_pParentLayouter );
aWriteLock.clear();
if ( bLayoutDirty && pParentLayouter )
- pParentLayouter->requestLayout( ILayoutNotifications::HINT_TOOLBARSPACE_HAS_CHANGED );
+ pParentLayouter->requestLayout( LayoutManager::HINT_TOOLBARSPACE_HAS_CHANGED );
}
}
@@ -3940,11 +3940,11 @@ throw (uno::RuntimeException, std::exception)
SolarMutexClearableGuard aWriteLock;
bool bNotify = !aUIElement.m_bFloating;
m_bLayoutDirty = bNotify;
- ILayoutNotifications* pParentLayouter( m_pParentLayouter );
+ LayoutManager* pParentLayouter( m_pParentLayouter );
aWriteLock.clear();
if ( bNotify && pParentLayouter )
- pParentLayouter->requestLayout( ILayoutNotifications::HINT_TOOLBARSPACE_HAS_CHANGED );
+ pParentLayouter->requestLayout( LayoutManager::HINT_TOOLBARSPACE_HAS_CHANGED );
}
}
}
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.hxx b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
index c41aeee..9649016 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.hxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
@@ -34,7 +34,7 @@
#include <uiconfiguration/globalsettings.hxx>
#include <framework/addonsoptions.hxx>
#include <uielement/uielement.hxx>
-#include <helper/ilayoutnotifications.hxx>
+#include <services/layoutmanager.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
@@ -74,7 +74,7 @@ class ToolbarLayoutManager : public ::cppu::WeakImplHelper< ::com::sun::star::aw
ToolbarLayoutManager( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElementFactory >& xUIElementFactory,
- ILayoutNotifications* pParentLayouter );
+ LayoutManager* pParentLayouter );
virtual ~ToolbarLayoutManager();
void reset();
@@ -274,7 +274,7 @@ class ToolbarLayoutManager : public ::cppu::WeakImplHelper< ::com::sun::star::aw
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xDocCfgMgr;
css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowState;
- ILayoutNotifications* m_pParentLayouter;
+ LayoutManager* m_pParentLayouter;
UIElementVector m_aUIElements;
UIElement m_aDockUIElement;
commit b981473658b4aecff544c1c1d9c25dc9b3a07b09
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 14:26:07 2015 +0200
loplugin:mergeclasses
Change-Id: I93bb1b9de62d30960028b719ee7ec773358c5c0f
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index ef38b98..22678bf 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -163,7 +163,6 @@ merge dbp::OModuleResourceClient with dbp::OUnoAutoPilot
merge dbtools::ISQLStatementHelper with connectivity::mysql::OTables
merge formula::ExternalReferenceHelper with ScExternalRefManager
merge formula::IStructHelper with formula::StructPage
-merge framework::IEditListener with framework::EditToolbarController
merge framework::ILayoutNotifications with framework::LayoutManager
merge framework::IListBoxListener with framework::DropdownToolbarController
merge framework::ISpinfieldListener with framework::SpinfieldToolbarController
diff --git a/framework/inc/uielement/edittoolbarcontroller.hxx b/framework/inc/uielement/edittoolbarcontroller.hxx
index 0b8f9b6..8af5eeb 100644
--- a/framework/inc/uielement/edittoolbarcontroller.hxx
+++ b/framework/inc/uielement/edittoolbarcontroller.hxx
@@ -34,21 +34,7 @@ namespace framework
class EditControl;
-class IEditListener
-{
- public:
- virtual void Modify() = 0;
- virtual void KeyInput( const KeyEvent& rKEvt ) = 0;
- virtual void GetFocus() = 0;
- virtual void LoseFocus() = 0;
- virtual bool PreNotify( NotifyEvent& rNEvt ) = 0;
-
- protected:
- ~IEditListener() {}
-};
-
-class EditToolbarController : public IEditListener,
- public ComplexToolbarController
+class EditToolbarController : public ComplexToolbarController
{
public:
@@ -63,12 +49,12 @@ class EditToolbarController : public IEditListener,
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
- // IEditListener
- virtual void Modify() SAL_OVERRIDE;
- virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
- virtual void GetFocus() SAL_OVERRIDE;
- virtual void LoseFocus() SAL_OVERRIDE;
- virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
+ // called from EditControl
+ void Modify();
+ void KeyInput( const KeyEvent& rKEvt );
+ void GetFocus();
+ void LoseFocus();
+ bool PreNotify( NotifyEvent& rNEvt );
protected:
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ) SAL_OVERRIDE;
diff --git a/framework/source/uielement/edittoolbarcontroller.cxx b/framework/source/uielement/edittoolbarcontroller.cxx
index 1ec9059..e780d29 100644
--- a/framework/source/uielement/edittoolbarcontroller.cxx
+++ b/framework/source/uielement/edittoolbarcontroller.cxx
@@ -51,7 +51,7 @@ namespace framework
class EditControl : public Edit
{
public:
- EditControl( vcl::Window* pParent, WinBits nStyle, IEditListener* pEditListener );
+ EditControl( vcl::Window* pParent, WinBits nStyle, EditToolbarController* pEditToolbarController );
virtual ~EditControl();
virtual void dispose() SAL_OVERRIDE;
@@ -62,12 +62,12 @@ class EditControl : public Edit
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
private:
- IEditListener* m_pEditListener;
+ EditToolbarController* m_pEditToolbarController;
};
-EditControl::EditControl( vcl::Window* pParent, WinBits nStyle, IEditListener* pEditListener ) :
+EditControl::EditControl( vcl::Window* pParent, WinBits nStyle, EditToolbarController* pEditToolbarController ) :
Edit( pParent, nStyle )
- , m_pEditListener( pEditListener )
+ , m_pEditToolbarController( pEditToolbarController )
{
}
@@ -78,43 +78,43 @@ EditControl::~EditControl()
void EditControl::dispose()
{
- m_pEditListener = 0;
+ m_pEditToolbarController = 0;
Edit::dispose();
}
void EditControl::Modify()
{
Edit::Modify();
- if ( m_pEditListener )
- m_pEditListener->Modify();
+ if ( m_pEditToolbarController )
+ m_pEditToolbarController->Modify();
}
void EditControl::KeyInput( const ::KeyEvent& rKEvt )
{
Edit::KeyInput( rKEvt );
- if ( m_pEditListener )
- m_pEditListener->KeyInput( rKEvt );
+ if ( m_pEditToolbarController )
+ m_pEditToolbarController->KeyInput( rKEvt );
}
void EditControl::GetFocus()
{
Edit::GetFocus();
- if ( m_pEditListener )
- m_pEditListener->GetFocus();
+ if ( m_pEditToolbarController )
+ m_pEditToolbarController->GetFocus();
}
void EditControl::LoseFocus()
{
Edit::LoseFocus();
- if ( m_pEditListener )
- m_pEditListener->LoseFocus();
+ if ( m_pEditToolbarController )
+ m_pEditToolbarController->LoseFocus();
}
bool EditControl::PreNotify( NotifyEvent& rNEvt )
{
bool bRet = false;
- if ( m_pEditListener )
- bRet = m_pEditListener->PreNotify( rNEvt );
+ if ( m_pEditToolbarController )
+ bRet = m_pEditToolbarController->PreNotify( rNEvt );
if ( !bRet )
bRet = Edit::PreNotify( rNEvt );
commit 973961ae604a46e4badb5a355d539f5d3573c4eb
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 14:23:31 2015 +0200
loplugin:mergeclasses
Change-Id: I01810a8db024e207783fc09b88bd932bca8ed103
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index 5d434d6..ef38b98 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -163,7 +163,6 @@ merge dbp::OModuleResourceClient with dbp::OUnoAutoPilot
merge dbtools::ISQLStatementHelper with connectivity::mysql::OTables
merge formula::ExternalReferenceHelper with ScExternalRefManager
merge formula::IStructHelper with formula::StructPage
-merge framework::IComboBoxListener with framework::ComboboxToolbarController
merge framework::IEditListener with framework::EditToolbarController
merge framework::ILayoutNotifications with framework::LayoutManager
merge framework::IListBoxListener with framework::DropdownToolbarController
diff --git a/framework/inc/uielement/comboboxtoolbarcontroller.hxx b/framework/inc/uielement/comboboxtoolbarcontroller.hxx
index 1850c45..df513d4 100644
--- a/framework/inc/uielement/comboboxtoolbarcontroller.hxx
+++ b/framework/inc/uielement/comboboxtoolbarcontroller.hxx
@@ -33,23 +33,7 @@ namespace framework
class ComboBoxControl;
-class IComboBoxListener
-{
- public:
- virtual void Select() = 0;
- virtual void DoubleClick() = 0;
- virtual void Modify() = 0;
- virtual void KeyInput( const KeyEvent& rKEvt ) = 0;
- virtual void GetFocus() = 0;
- virtual void LoseFocus() = 0;
- virtual bool PreNotify( NotifyEvent& rNEvt ) = 0;
-
- protected:
- ~IComboBoxListener() {}
-};
-
-class ComboboxToolbarController : public IComboBoxListener,
- public ComplexToolbarController
+class ComboboxToolbarController : public ComplexToolbarController
{
public:
@@ -64,14 +48,14 @@ class ComboboxToolbarController : public IComboBoxListener,
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
- // IComboBoxListener
- virtual void Select() SAL_OVERRIDE;
- virtual void DoubleClick() SAL_OVERRIDE;
- virtual void Modify() SAL_OVERRIDE;
- virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
- virtual void GetFocus() SAL_OVERRIDE;
- virtual void LoseFocus() SAL_OVERRIDE;
- virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
+ // called from ComboBoxControl
+ void Select();
+ void DoubleClick();
+ void Modify();
+ void KeyInput( const KeyEvent& rKEvt );
+ void GetFocus();
+ void LoseFocus();
+ bool PreNotify( NotifyEvent& rNEvt );
protected:
virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ) SAL_OVERRIDE;
diff --git a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
index 9b37036..956b53b 100644
--- a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
+++ b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
@@ -63,7 +63,7 @@ class DropdownToolbarController : public IListBoxListener,
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
- // IComboBoxListener
+ // IListBoxListener
virtual void Select() SAL_OVERRIDE;
virtual void DoubleClick() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index ec54cd1..3d62f50 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -47,13 +47,13 @@ namespace framework
{
// Wrapper class to notify controller about events from combobox.
-// Unfortunaltly the events are notifed through virtual methods instead
+// Unfortunately the events are notified through virtual methods instead
// of Listeners.
class ComboBoxControl : public ComboBox
{
public:
- ComboBoxControl( vcl::Window* pParent, WinBits nStyle, IComboBoxListener* pComboBoxListener );
+ ComboBoxControl( vcl::Window* pParent, WinBits nStyle, ComboboxToolbarController* pComboboxToolbarController );
virtual ~ComboBoxControl();
virtual void dispose() SAL_OVERRIDE;
@@ -66,12 +66,12 @@ class ComboBoxControl : public ComboBox
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
private:
- IComboBoxListener* m_pComboBoxListener;
+ ComboboxToolbarController* m_pComboboxToolbarController;
};
-ComboBoxControl::ComboBoxControl( vcl::Window* pParent, WinBits nStyle, IComboBoxListener* pComboBoxListener ) :
+ComboBoxControl::ComboBoxControl( vcl::Window* pParent, WinBits nStyle, ComboboxToolbarController* pComboboxToolbarController ) :
ComboBox( pParent, nStyle )
- , m_pComboBoxListener( pComboBoxListener )
+ , m_pComboboxToolbarController( pComboboxToolbarController )
{
}
@@ -82,57 +82,57 @@ ComboBoxControl::~ComboBoxControl()
void ComboBoxControl::dispose()
{
- m_pComboBoxListener = 0;
+ m_pComboboxToolbarController = 0;
ComboBox::dispose();
}
void ComboBoxControl::Select()
{
ComboBox::Select();
- if ( m_pComboBoxListener )
- m_pComboBoxListener->Select();
+ if ( m_pComboboxToolbarController )
+ m_pComboboxToolbarController->Select();
}
void ComboBoxControl::DoubleClick()
{
ComboBox::DoubleClick();
- if ( m_pComboBoxListener )
- m_pComboBoxListener->DoubleClick();
+ if ( m_pComboboxToolbarController )
+ m_pComboboxToolbarController->DoubleClick();
}
void ComboBoxControl::Modify()
{
ComboBox::Modify();
- if ( m_pComboBoxListener )
- m_pComboBoxListener->Modify();
+ if ( m_pComboboxToolbarController )
+ m_pComboboxToolbarController->Modify();
}
void ComboBoxControl::KeyInput( const ::KeyEvent& rKEvt )
{
ComboBox::KeyInput( rKEvt );
- if ( m_pComboBoxListener )
- m_pComboBoxListener->KeyInput( rKEvt );
+ if ( m_pComboboxToolbarController )
+ m_pComboboxToolbarController->KeyInput( rKEvt );
}
void ComboBoxControl::GetFocus()
{
ComboBox::GetFocus();
- if ( m_pComboBoxListener )
- m_pComboBoxListener->GetFocus();
+ if ( m_pComboboxToolbarController )
+ m_pComboboxToolbarController->GetFocus();
}
void ComboBoxControl::LoseFocus()
{
ComboBox::LoseFocus();
- if ( m_pComboBoxListener )
- m_pComboBoxListener->LoseFocus();
+ if ( m_pComboboxToolbarController )
+ m_pComboboxToolbarController->LoseFocus();
}
bool ComboBoxControl::PreNotify( NotifyEvent& rNEvt )
{
bool bRet = false;
- if ( m_pComboBoxListener )
- bRet = m_pComboBoxListener->PreNotify( rNEvt );
+ if ( m_pComboboxToolbarController )
+ bRet = m_pComboboxToolbarController->PreNotify( rNEvt );
if ( !bRet )
bRet = ComboBox::PreNotify( rNEvt );
commit 94b0c2203b4efd46c0da06f4918c610909103bd8
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 14:16:56 2015 +0200
loplugin:mergeclasses
Change-Id: Ia19514d33fd025a1df9d26b94e2d39113d122392
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index e7a972b..5d434d6 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -161,7 +161,6 @@ merge dbmm::IProgressConsumer with dbmm::ProgressDelegator
merge dbmm::MacroMigrationModuleClient with dbmm::MacroMigrationDialogService
merge dbp::OModuleResourceClient with dbp::OUnoAutoPilot
merge dbtools::ISQLStatementHelper with connectivity::mysql::OTables
-merge extensions::resource::IResourceType with extensions::resource::StringResourceAccess
merge formula::ExternalReferenceHelper with ScExternalRefManager
merge formula::IStructHelper with formula::StructPage
merge framework::IComboBoxListener with framework::ComboboxToolbarController
diff --git a/extensions/source/resource/oooresourceloader.cxx b/extensions/source/resource/oooresourceloader.cxx
index 512e120..dd63a5d 100644
--- a/extensions/source/resource/oooresourceloader.cxx
+++ b/extensions/source/resource/oooresourceloader.cxx
@@ -39,13 +39,14 @@ namespace extensions { namespace resource
{
/** encapsulates access to a fixed resource type
*/
- class IResourceType
+ class StringResourceAccess
{
public:
+ StringResourceAccess();
+
/** returns the RESOURCE_TYPE associated with this instance
*/
- virtual RESOURCE_TYPE getResourceType() const = 0;
-
+ static RESOURCE_TYPE getResourceType();
/** reads a single resource from the given resource manager
@param _resourceManager
the resource manager to read from
@@ -57,31 +58,19 @@ namespace extensions { namespace resource
the caller checked via <code>_resourceManager.IsAvailable( getResourceType(), _resourceId )</code>
that the required resource really exists
*/
- virtual Any getResource( SimpleResMgr& _resourceManager, sal_Int32 _resourceId ) const = 0;
-
- virtual ~IResourceType() { };
- };
-
- class StringResourceAccess : public IResourceType
- {
- public:
- StringResourceAccess();
-
- // IResourceType
- virtual RESOURCE_TYPE getResourceType() const SAL_OVERRIDE;
- virtual Any getResource( SimpleResMgr& _resourceManager, sal_Int32 _resourceId ) const SAL_OVERRIDE;
+ static Any getResource( SimpleResMgr& _resourceManager, sal_Int32 _resourceId );
};
StringResourceAccess::StringResourceAccess()
{
}
- RESOURCE_TYPE StringResourceAccess::getResourceType() const
+ RESOURCE_TYPE StringResourceAccess::getResourceType()
{
return RSC_STRING;
}
- Any StringResourceAccess::getResource( SimpleResMgr& _resourceManager, sal_Int32 _resourceId ) const
+ Any StringResourceAccess::getResource( SimpleResMgr& _resourceManager, sal_Int32 _resourceId )
{
OSL_PRECOND( _resourceManager.IsAvailable( getResourceType(), _resourceId ), "StringResourceAccess::getResource: precondition not met!" );
Any aResource;
@@ -94,7 +83,7 @@ namespace extensions { namespace resource
class OpenOfficeResourceBundle : public OpenOfficeResourceBundle_Base
{
private:
- typedef std::shared_ptr< IResourceType > ResourceTypePtr;
+ typedef std::shared_ptr< StringResourceAccess > ResourceTypePtr;
typedef ::std::map< OUString, ResourceTypePtr > ResourceTypes;
::osl::Mutex m_aMutex;
@@ -257,11 +246,11 @@ namespace extensions { namespace resource
if ( !impl_getResourceTypeAndId_nothrow( _key, resourceType, resourceId ) )
return false;
- if ( !m_pResourceManager->IsAvailable( resourceType->getResourceType(), resourceId ) )
+ if ( !m_pResourceManager->IsAvailable( StringResourceAccess::getResourceType(), resourceId ) )
// no such resource with the given type/id
return false;
- _out_Element = resourceType->getResource( *m_pResourceManager, resourceId );
+ _out_Element = StringResourceAccess::getResource( *m_pResourceManager, resourceId );
return _out_Element.hasValue();
}
@@ -308,7 +297,7 @@ namespace extensions { namespace resource
if ( !impl_getResourceTypeAndId_nothrow( _key, resourceType, resourceId ) )
return sal_False;
- if ( !m_pResourceManager->IsAvailable( resourceType->getResourceType(), resourceId ) )
+ if ( !m_pResourceManager->IsAvailable( StringResourceAccess::getResourceType(), resourceId ) )
return sal_False;
return sal_True;
commit 2e658321f51af2fa3da14b3240c50942a345613c
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 14:10:44 2015 +0200
loplugin:mergeclasses
Change-Id: I84dee96b7a1f72db46e3330ec5195367dfce894a
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index 82d53c3..e7a972b 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -155,7 +155,6 @@ merge dbaui::(anonymous namespace)::ILabelProvider with dbaui::(anonymous namesp
merge dbaui::IApplicationController with dbaui::OApplicationController
merge dbaui::IEntryFilter with dbaui::(anonymous namespace)::FilterByEntryDataId
merge dbaui::OOdbcLibWrapper with dbaui::OOdbcEnumeration
-merge dbaui::PropertyStorage with dbaui::SetItemPropertyStorage
merge dbaui::SbaGridListener with dbaui::SbaXDataBrowserController
merge dbmm::IMigrationProgress with dbmm::ProgressPage
merge dbmm::IProgressConsumer with dbmm::ProgressDelegator
diff --git a/dbaccess/source/ui/inc/propertystorage.hxx b/dbaccess/source/ui/inc/propertystorage.hxx
index 2432064..9699e5a 100644
--- a/dbaccess/source/ui/inc/propertystorage.hxx
+++ b/dbaccess/source/ui/inc/propertystorage.hxx
@@ -29,45 +29,27 @@ class SfxItemSet;
namespace dbaui
{
- // PropertyStorage
- class SAL_NO_VTABLE PropertyStorage
- {
- public:
- virtual void getPropertyValue( css::uno::Any& _out_rValue ) const = 0;
- virtual void setPropertyValue( const css::uno::Any& _rValue ) = 0;
-
- virtual ~PropertyStorage();
- };
-
- typedef std::shared_ptr< PropertyStorage > PPropertyStorage;
- typedef ::std::map< sal_Int32, PPropertyStorage > PropertyValues;
-
- // SetItemPropertyStorage
- typedef sal_uInt16 ItemId;
-
/** a PropertyStorage implementation which stores the value in an item set
*/
- class SetItemPropertyStorage : public PropertyStorage
+ class SetItemPropertyStorage
{
public:
- SetItemPropertyStorage( SfxItemSet& _rItemSet, const ItemId _nItemID )
+ SetItemPropertyStorage( SfxItemSet& _rItemSet, const sal_uInt16 _nItemID )
:m_rItemSet( _rItemSet )
,m_nItemID( _nItemID )
{
}
- virtual ~SetItemPropertyStorage()
- {
- }
-
- virtual void getPropertyValue( css::uno::Any& _out_rValue ) const SAL_OVERRIDE;
- virtual void setPropertyValue( const css::uno::Any& _rValue ) SAL_OVERRIDE;
+ void getPropertyValue( css::uno::Any& _out_rValue ) const;
+ void setPropertyValue( const css::uno::Any& _rValue );
private:
- SfxItemSet& m_rItemSet;
- const ItemId m_nItemID;
+ SfxItemSet& m_rItemSet;
+ const sal_uInt16 m_nItemID;
};
+ typedef ::std::map< sal_Int32, std::shared_ptr< SetItemPropertyStorage > > PropertyValues;
+
} // namespace dbaui
#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_PROPERTYSTORAGE_HXX
diff --git a/dbaccess/source/ui/misc/propertystorage.cxx b/dbaccess/source/ui/misc/propertystorage.cxx
index ba9be1c..e1f5ea5 100644
--- a/dbaccess/source/ui/misc/propertystorage.cxx
+++ b/dbaccess/source/ui/misc/propertystorage.cxx
@@ -39,20 +39,14 @@ namespace dbaui
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::makeAny;
- // PropertyStorage
- PropertyStorage::~PropertyStorage()
- {
- }
-
// helper
namespace
{
- #undef UNOTYPE
template < class ITEMTYPE, class UNOTYPE >
class ItemAdapter
{
public:
- static bool trySet( SfxItemSet& _rSet, ItemId _nItemId, const Any& _rValue )
+ static bool trySet( SfxItemSet& _rSet, sal_uInt16 _nItemId, const Any& _rValue )
{
const SfxPoolItem& rItem( _rSet.Get( _nItemId ) );
const ITEMTYPE* pTypedItem = dynamic_cast< const ITEMTYPE* >( &rItem );
commit 4281599a0430eba3fcad672e0e13edcb32175d7a
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 12:38:33 2015 +0200
loplugin:mergeclasses
Change-Id: If5da1527a048997aec1dbc07afbdddabd2c4168d
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index adcd73d..82d53c3 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -136,7 +136,6 @@ merge chart::ResourceChangeListener with chart::ChartTypeTabPage
merge chart::WindowController with chart::ChartController
merge comphelper::IPropertyInfoService with frm::ConcreteInfoService
merge comphelper::NameContainerImpl with comphelper::NameContainer
-merge comphelper::OInteractionSelect with comphelper::OInteraction
merge comphelper::OSeekableInputWrapper_BASE with comphelper::OSeekableInputWrapper
merge comphelper::OStatefulPropertySet with PropertySetBase
merge connectivity::hsqldb::IMethodGuardAccess with connectivity::hsqldb::OHsqlConnection
diff --git a/include/comphelper/interaction.hxx b/include/comphelper/interaction.hxx
index 7135d99..99e6caf 100644
--- a/include/comphelper/interaction.hxx
+++ b/include/comphelper/interaction.hxx
@@ -36,26 +36,6 @@ namespace comphelper
- //= OInteractionSelect
-
- /** base class for concrete XInteractionContinuation implementations.<p/>
- Instances of the classes maintain a flag indicating if the handler was called.
- */
- class OInteractionSelect
- {
- bool m_bSelected : 1; /// indicates if the select event occurred
-
- protected:
- OInteractionSelect() : m_bSelected(false) { }
-
- public:
- /// determines whether or not this handler was selected
- bool wasSelected() const { return m_bSelected; }
- protected:
- void implSelected() { m_bSelected = true; }
- };
-
-
//= OInteraction
/** template for instantiating concret interaction handlers<p/>
@@ -63,21 +43,25 @@ namespace comphelper
*/
template <class INTERACTION>
class OInteraction
- :public ::cppu::WeakImplHelper< INTERACTION >
- ,public OInteractionSelect
+ : public ::cppu::WeakImplHelper< INTERACTION >
{
public:
- OInteraction() { }
+ OInteraction() : m_bSelected(false) {}
+
+ /// determines whether or not this handler was selected
+ bool wasSelected() const { return m_bSelected; }
- // XInteractionContinuation
- virtual void SAL_CALL select( ) throw(::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
+ // XInteractionContinuation
+ virtual void SAL_CALL select() throw(::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
+ private:
+ bool m_bSelected : 1; /// indicates if the select event occurred
};
template <class INTERACTION>
void SAL_CALL OInteraction< INTERACTION >::select( ) throw(::com::sun::star::uno::RuntimeException)
{
- implSelected();
+ m_bSelected = true;
}
commit e7311cbaba988f96104dcbd96151436a6873e356
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 11:58:03 2015 +0200
loplugin:mergeclasses
Change-Id: Ia3b63df5e8752690e3350f8a13445a096a839952
diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx
index 5b5f3a1..0f9f679 100644
--- a/comphelper/source/container/enumerablemap.cxx
+++ b/comphelper/source/container/enumerablemap.cxx
@@ -83,8 +83,7 @@ namespace comphelper
using ::com::sun::star::lang::WrappedTargetException;
using ::com::sun::star::lang::DisposedException;
- class IMapModificationListener;
- typedef ::std::vector< IMapModificationListener* > MapListeners;
+ class MapEnumerator;
typedef ::std::map< Any, Any, LessPredicateAdapter > KeyedValues;
struct MapData
@@ -94,7 +93,7 @@ namespace comphelper
::std::unique_ptr< KeyedValues > m_pValues;
::std::shared_ptr< IKeyPredicateLess > m_pKeyCompare;
bool m_bMutable;
- MapListeners m_aModListeners;
+ ::std::vector< MapEnumerator* > m_aModListeners;
MapData()
:m_bMutable( true )
@@ -115,36 +114,21 @@ namespace comphelper
};
- /** implemented by components who want to be notified of modifications in the MapData they work with
- */
- class SAL_NO_VTABLE IMapModificationListener
- {
- public:
- /// called when the map was modified
- virtual void mapModified() = 0;
- virtual ~IMapModificationListener()
- {
- }
- };
-
- static void lcl_registerMapModificationListener( MapData& _mapData, IMapModificationListener& _listener )
+ static void lcl_registerMapModificationListener( MapData& _mapData, MapEnumerator& _listener )
{
#if OSL_DEBUG_LEVEL > 0
- for ( MapListeners::const_iterator lookup = _mapData.m_aModListeners.begin();
- lookup != _mapData.m_aModListeners.end();
- ++lookup
- )
+ for ( const MapEnumerator* lookup : _mapData.m_aModListeners )
{
- OSL_ENSURE( *lookup != &_listener, "lcl_registerMapModificationListener: this listener is already registered!" );
+ OSL_ENSURE( lookup != &_listener, "lcl_registerMapModificationListener: this listener is already registered!" );
}
#endif
_mapData.m_aModListeners.push_back( &_listener );
}
- static void lcl_revokeMapModificationListener( MapData& _mapData, IMapModificationListener& _listener )
+ static void lcl_revokeMapModificationListener( MapData& _mapData, MapEnumerator& _listener )
{
- for ( MapListeners::iterator lookup = _mapData.m_aModListeners.begin();
+ for ( ::std::vector< MapEnumerator* >::iterator lookup = _mapData.m_aModListeners.begin();
lookup != _mapData.m_aModListeners.end();
++lookup
)
@@ -159,16 +143,7 @@ namespace comphelper
}
- static void lcl_notifyMapDataListeners_nothrow( const MapData& _mapData )
- {
- for ( MapListeners::const_iterator loop = _mapData.m_aModListeners.begin();
- loop != _mapData.m_aModListeners.end();
- ++loop
- )
- {
- (*loop)->mapModified();
- }
- }
+ static void lcl_notifyMapDataListeners_nothrow( const MapData& _mapData );
// EnumerableMap
@@ -242,8 +217,7 @@ namespace comphelper
};
- class MapEnumerator:
- public IMapModificationListener, private boost::noncopyable
+ class MapEnumerator: private boost::noncopyable
{
public:
MapEnumerator( ::cppu::OWeakObject& _rParent, MapData& _mapData, const EnumerationType _type )
@@ -274,8 +248,8 @@ namespace comphelper
bool hasMoreElements();
Any nextElement();
- // IMapModificationListener
- virtual void mapModified() SAL_OVERRIDE;
+ /// called when the map was modified
+ void mapModified();
private:
::cppu::OWeakObject& m_rParent;
@@ -285,6 +259,13 @@ namespace comphelper
bool m_disposed;
};
+ static void lcl_notifyMapDataListeners_nothrow( const MapData& _mapData )
+ {
+ for ( MapEnumerator* loop : _mapData.m_aModListeners )
+ {
+ loop->mapModified();
+ }
+ }
typedef ::cppu::WeakImplHelper < XEnumeration
> MapEnumeration_Base;
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index f7d1499..adcd73d 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -134,7 +134,6 @@ merge chart::LegendEntryProvider with chart::VSeriesPlotter
merge chart::MarkHandleProvider with chart::SelectionHelper
merge chart::ResourceChangeListener with chart::ChartTypeTabPage
merge chart::WindowController with chart::ChartController
-merge comphelper::IMapModificationListener with comphelper::MapEnumerator
merge comphelper::IPropertyInfoService with frm::ConcreteInfoService
merge comphelper::NameContainerImpl with comphelper::NameContainer
merge comphelper::OInteractionSelect with comphelper::OInteraction
commit 05e61719e2f4456fab8f5f9875fd96c70c07c4cd
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 11:48:40 2015 +0200
loplugin:mergeclasses
Change-Id: If918532fcc860e3deacd9c86dd7a2d554e4f748d
diff --git a/chart2/source/controller/main/UndoActions.hxx b/chart2/source/controller/main/UndoActions.hxx
index e1e80c8..c2edb73 100644
--- a/chart2/source/controller/main/UndoActions.hxx
+++ b/chart2/source/controller/main/UndoActions.hxx
@@ -19,8 +19,6 @@
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_UNDOACTIONS_HXX
#define INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_UNDOACTIONS_HXX
-#include "ConfigItemListener.hxx"
-
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/document/XUndoAction.hpp>
#include <com/sun/star/uno/Sequence.hxx>
diff --git a/chart2/source/inc/ConfigColorScheme.hxx b/chart2/source/inc/ConfigColorScheme.hxx
index 6214211..36f9efd 100644
--- a/chart2/source/inc/ConfigColorScheme.hxx
+++ b/chart2/source/inc/ConfigColorScheme.hxx
@@ -19,7 +19,6 @@
#ifndef INCLUDED_CHART2_SOURCE_INC_CONFIGCOLORSCHEME_HXX
#define INCLUDED_CHART2_SOURCE_INC_CONFIGCOLORSCHEME_HXX
-#include "ConfigItemListener.hxx"
#include "charttoolsdllapi.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
@@ -42,7 +41,6 @@ class ChartConfigItem;
}
class ConfigColorScheme :
- public ConfigItemListener,
public ::cppu::WeakImplHelper<
::com::sun::star::chart2::XColorScheme,
::com::sun::star::lang::XServiceInfo >
@@ -64,14 +62,14 @@ public:
static OUString getImplementationName_Static();
static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
+ // ____ ConfigItemListener ____
+ SAL_DLLPRIVATE void notify( const OUString & rPropertyName );
+
protected:
// ____ XColorScheme ____
SAL_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getColorByIndex( ::sal_Int32 nIndex )
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- // ____ ConfigItemListener ____
- SAL_DLLPRIVATE virtual void notify( const OUString & rPropertyName ) SAL_OVERRIDE;
-
private:
SAL_DLLPRIVATE void retrieveConfigColors();
diff --git a/chart2/source/inc/ConfigItemListener.hxx b/chart2/source/inc/ConfigItemListener.hxx
deleted file mode 100644
index 7d3b82e..0000000
--- a/chart2/source/inc/ConfigItemListener.hxx
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_CHART2_SOURCE_INC_CONFIGITEMLISTENER_HXX
-#define INCLUDED_CHART2_SOURCE_INC_CONFIGITEMLISTENER_HXX
-
-#include <rtl/ustring.hxx>
-#include "charttoolsdllapi.hxx"
-
-namespace chart
-{
-
-class OOO_DLLPUBLIC_CHARTTOOLS ConfigItemListener
-{
-public:
- virtual void notify( const OUString & rPropertyName ) = 0;
-
-protected:
- ~ConfigItemListener() {}
-};
-
-} // namespace chart
-
-// INCLUDED_CHART2_SOURCE_INC_CONFIGITEMLISTENER_HXX
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx
index 3743205..cfd000f 100644
--- a/chart2/source/tools/ConfigColorScheme.cxx
+++ b/chart2/source/tools/ConfigColorScheme.cxx
@@ -52,31 +52,27 @@ namespace impl
class ChartConfigItem : public ::utl::ConfigItem
{
public:
- explicit ChartConfigItem( ConfigItemListener & rListener );
- virtual ~ChartConfigItem();
+ explicit ChartConfigItem( ConfigColorScheme & rListener );
+ virtual ~ChartConfigItem() {}
void addPropertyNotification( const OUString & rPropertyName );
-
uno::Any getProperty( const OUString & aPropertyName );
protected:
// ____ ::utl::ConfigItem ____
- virtual void ImplCommit() SAL_OVERRIDE;
+ virtual void ImplCommit() SAL_OVERRIDE;
virtual void Notify( const Sequence< OUString > & aPropertyNames ) SAL_OVERRIDE;
private:
- ConfigItemListener & m_rListener;
- ::std::set< OUString > m_aPropertiesToNotify;
+ ConfigColorScheme & m_rListener;
+ ::std::set< OUString > m_aPropertiesToNotify;
};
-ChartConfigItem::ChartConfigItem( ConfigItemListener & rListener ) :
+ChartConfigItem::ChartConfigItem( ConfigColorScheme & rListener ) :
::utl::ConfigItem( "Office.Chart/DefaultColor" ),
m_rListener( rListener )
{}
-ChartConfigItem::~ChartConfigItem()
-{}
-
void ChartConfigItem::Notify( const Sequence< OUString > & aPropertyNames )
{
for( sal_Int32 nIdx=0; nIdx<aPropertyNames.getLength(); ++nIdx )
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index 3da0ff9..f7d1499 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -129,7 +129,6 @@ merge cairocanvas::DeviceHelper with cairocanvas::SpriteDeviceHelper
merge cairocanvas::Sprite with cairocanvas::CanvasCustomSpriteSpriteBase_Base
merge canvas::ISurfaceProxy with canvas::SurfaceProxy
merge canvas::ISurfaceProxyManager with canvas::SurfaceProxyManager
-merge chart::ConfigItemListener with chart::ConfigColorScheme
merge chart::ExplicitValueProvider with chart::ChartView
merge chart::LegendEntryProvider with chart::VSeriesPlotter
merge chart::MarkHandleProvider with chart::SelectionHelper
commit 2b57de8bb0064be828265bf08805b1bc345e62bf
Author: Noel Grandin <noel at peralex.com>
Date: Tue Oct 6 11:42:41 2015 +0200
remove another custom refcounting base class
Change-Id: Icd8a8d79da0ada68e9ee869c3c2a7b93db5b2733
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index 9f8b65f..080eef3 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -31,6 +31,7 @@ $(eval $(call gb_Library_use_libraries,chartcontroller,\
drawinglayer \
editeng \
sal \
+ salhelper \
i18nlangtag \
sfx \
sot \
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx
index cdb23aa..59a3741 100644
--- a/chart2/source/controller/inc/ChartController.hxx
+++ b/chart2/source/controller/inc/ChartController.hxx
@@ -447,17 +447,7 @@ private:
private:
class TheModelRef;
friend class ChartController::TheModelRef;
- class RefCountable
- {
- public:
- RefCountable();
- virtual ~RefCountable();
- void acquire();
- void release();
- private:
- sal_Int32 m_nRefCount;
- };
- class TheModel : public RefCountable
+ class TheModel : public salhelper::SimpleReferenceObject
{
public:
explicit TheModel( const ::com::sun::star::uno::Reference<
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 045837e..8b16543 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -131,24 +131,6 @@ ChartController::~ChartController()
stopDoubleClickWaiting();
}
-ChartController::RefCountable::RefCountable() : m_nRefCount(0)
-{
-}
-
-ChartController::RefCountable::~RefCountable()
-{
-}
-void ChartController::RefCountable::acquire()
-{
- m_nRefCount++;
-}
-void ChartController::RefCountable::release()
-{
- m_nRefCount--;
- if(!m_nRefCount)
- delete this;
-}
-
ChartController::TheModel::TheModel( const uno::Reference< frame::XModel > & xModel ) :
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list