[Libreoffice-commits] core.git: Branch 'feature/item_refactor2' - include/item item/source
Armin Le Grand (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 6 13:46:55 UTC 2019
include/item/base/ItemAdministrator.hxx | 2 +-
include/item/base/ItemBase.hxx | 6 ++++--
include/item/base/ItemBuffered.hxx | 8 +++++---
include/item/base/ItemControlBlock.hxx | 5 +++--
item/source/base/ItemBase.cxx | 11 +++++++----
item/source/base/ItemBuffered.cxx | 19 ++++++++++---------
item/source/base/ItemControlBlock.cxx | 2 +-
7 files changed, 31 insertions(+), 22 deletions(-)
New commits:
commit 4b0409c319abd3248360345cf7d86d66b932d513
Author: Armin Le Grand <Armin.Le.Grand at me.com>
AuthorDate: Mon May 6 15:45:26 2019 +0200
Commit: Armin Le Grand <Armin.Le.Grand at me.com>
CommitDate: Mon May 6 15:45:26 2019 +0200
WIP: Linux build changes
Change-Id: I3ea79f9a48f626681604e871143c0adec7c0cb7a
diff --git a/include/item/base/ItemAdministrator.hxx b/include/item/base/ItemAdministrator.hxx
index 4b77f5ffafca..18a3a6eb953a 100644
--- a/include/item/base/ItemAdministrator.hxx
+++ b/include/item/base/ItemAdministrator.hxx
@@ -31,7 +31,7 @@
namespace Item
{
- class ItemAdministrator
+ class ITEM_DLLPUBLIC ItemAdministrator
{
private:
std::function<ItemBuffered::ItemData*()> m_aConstructItem;
diff --git a/include/item/base/ItemBase.hxx b/include/item/base/ItemBase.hxx
index 44c597cddbed..b93d5b196ce9 100644
--- a/include/item/base/ItemBase.hxx
+++ b/include/item/base/ItemBase.hxx
@@ -42,7 +42,7 @@ namespace Item
// PutValue/Any interface for automated instance creation from SfxType
// mechanism (UNO API and sfx2 stuff)
- virtual void putValues(const AnyIDArgs& rArgs);
+ virtual void putAnyValues(const AnyIDArgs& rArgs);
private:
// local reference to instance of ItemControlBlock for this
@@ -55,10 +55,12 @@ namespace Item
protected:
// PutValue/Any interface for automated instance creation from SfxType
// mechanism (UNO API and sfx2 stuff)
- virtual void putValue(const css::uno::Any& rVal, sal_uInt8 nMemberId);
+ virtual void putAnyValue(const css::uno::Any& rVal, sal_uInt8 nMemberId);
public:
ItemBase(ItemControlBlock& rItemControlBlock);
+ virtual ~ItemBase();
+
ItemBase(const ItemBase&);
ItemBase& operator=(const ItemBase&);
diff --git a/include/item/base/ItemBuffered.hxx b/include/item/base/ItemBuffered.hxx
index 82647198efaf..43727586ffbf 100755
--- a/include/item/base/ItemBuffered.hxx
+++ b/include/item/base/ItemBuffered.hxx
@@ -29,6 +29,8 @@
namespace Item
{
+ class ItemAdministrator;
+
class ITEM_DLLPUBLIC ItemBuffered : public ItemBase
{
public:
@@ -44,7 +46,7 @@ namespace Item
// PutValue/Any interface for automated instance creation from SfxType
// mechanism (UNO API and sfx2 stuff)
- virtual void putValue(const css::uno::Any& rVal, sal_uInt8 nMemberId);
+ virtual void putAnyValue(const css::uno::Any& rVal, sal_uInt8 nMemberId);
public:
ItemData();
@@ -67,7 +69,7 @@ namespace Item
public:
// PutValue/Any interface for automated instance creation from SfxType
// mechanism (UNO API and sfx2 stuff)
- virtual void putValues(const AnyIDArgs& rArgs);
+ virtual void putAnyValues(const AnyIDArgs& rArgs);
protected:
// Method to internally (thus protected) set a new ItemData
@@ -90,7 +92,7 @@ namespace Item
virtual ~ItemBuffered();
ItemBuffered& operator=(const ItemBuffered&);
- virtual bool operator==(const ItemBuffered&) const;
+ virtual bool operator==(const ItemBase&) const;
virtual std::unique_ptr<ItemBase> clone() const;
};
} // end of namespace Item
diff --git a/include/item/base/ItemControlBlock.hxx b/include/item/base/ItemControlBlock.hxx
index b83f37333d29..80effd85a24a 100755
--- a/include/item/base/ItemControlBlock.hxx
+++ b/include/item/base/ItemControlBlock.hxx
@@ -22,15 +22,16 @@
#include <sal/types.h>
#include <item/itemdllapi.h>
+#include <item/base/ItemBase.hxx>
#include <functional>
+#include <memory>
+#include <rtl/ustring.hxx>
///////////////////////////////////////////////////////////////////////////////
namespace Item
{
// predefine - no need to include
- class ItemBase;
-
class ITEM_DLLPUBLIC ItemControlBlock
{
private:
diff --git a/item/source/base/ItemBase.cxx b/item/source/base/ItemBase.cxx
index 158972837d15..40be2aeb73f8 100644
--- a/item/source/base/ItemBase.cxx
+++ b/item/source/base/ItemBase.cxx
@@ -8,7 +8,6 @@
*/
#include <item/base/ItemBase.hxx>
-// #include <item/base/ItemAdministrator.hxx>
#include <item/base/ItemControlBlock.hxx>
#include <cassert>
@@ -86,18 +85,18 @@ Nonetheless these SlotItems STILL depend on the SfxItem-RANGES defined in the Sf
namespace Item
{
- void ItemBase::putValues(const AnyIDArgs& rArgs)
+ void ItemBase::putAnyValues(const AnyIDArgs& rArgs)
{
if(!rArgs.empty())
{
for(const auto& arg : rArgs)
{
- putValue(arg.first, arg.second);
+ putAnyValue(arg.first, arg.second);
}
}
}
- void ItemBase::putValue(const css::uno::Any& /*rVal*/, sal_uInt8 /*nMemberId*/)
+ void ItemBase::putAnyValue(const css::uno::Any& /*rVal*/, sal_uInt8 /*nMemberId*/)
{
}
@@ -106,6 +105,10 @@ namespace Item
{
}
+ ItemBase::~ItemBase()
+ {
+ }
+
ItemBase::ItemBase(const ItemBase& rRef)
: m_rItemControlBlock(rRef.m_rItemControlBlock)
{
diff --git a/item/source/base/ItemBuffered.cxx b/item/source/base/ItemBuffered.cxx
index 4cfa20986e64..0006672ee768 100755
--- a/item/source/base/ItemBuffered.cxx
+++ b/item/source/base/ItemBuffered.cxx
@@ -15,7 +15,7 @@
namespace Item
{
- void ItemBuffered::ItemData::putValue(const css::uno::Any& /*rVal*/, sal_uInt8 /*nMemberId*/)
+ void ItemBuffered::ItemData::putAnyValue(const css::uno::Any& /*rVal*/, sal_uInt8 /*nMemberId*/)
{
// not intended to be used, error
assert(false && "Error: Some instance tries to set an Any at an ::ItemData instance - implement ItemData::putValue method there (!)");
@@ -96,18 +96,18 @@ namespace Item
}
}
- void ItemBuffered::putValues(const AnyIDArgs& rArgs)
+ void ItemBuffered::putAnyValues(const AnyIDArgs& rArgs)
{
- assert(nullptr != m_pItemData && "ItemBuffered::putValues called but m_pItemData not set (!)");
+ assert(nullptr != m_pItemData && "ItemBuffered::putAnyValues called but m_pItemData not set (!)");
if(!rArgs.empty())
{
ItemData* pNewItemData(m_pItemData->getItemAdministrator().createNewDataInstance());
- assert(nullptr != pNewItemData && "ItemBuffered::putValues could not create new ItemData instance (!)");
+ assert(nullptr != pNewItemData && "ItemBuffered::putAnyValues could not create new ItemData instance (!)");
for(const auto& arg : rArgs)
{
- pNewItemData->putValue(arg.first, arg.second);
+ pNewItemData->putAnyValue(arg.first, arg.second);
}
setItemData(pNewItemData);
@@ -145,13 +145,14 @@ namespace Item
return *this;
}
- bool ItemBuffered::operator==(const ItemBuffered& rRef) const
+ bool ItemBuffered::operator==(const ItemBase& rRef) const
{
- assert(nullptr != m_pItemData && nullptr != rRef.m_pItemData && "ItemBuffered::operator== called but not all m_pItemData set (!)");
+ const ItemBuffered& rTmpRef(static_cast<const ItemBuffered&>(rRef));
+ assert(nullptr != m_pItemData && nullptr != rTmpRef.m_pItemData && "ItemBuffered::operator== called but not all m_pItemData set (!)");
return (
ItemBase::operator==(rRef) || // ptr-compare
- m_pItemData == rRef.m_pItemData || // ItemData ptr-compare
- *m_pItemData == *rRef.m_pItemData); // ItemData content compare
+ m_pItemData == rTmpRef.m_pItemData || // ItemData ptr-compare
+ *m_pItemData == *rTmpRef.m_pItemData); // ItemData content compare
}
std::unique_ptr<ItemBase> ItemBuffered::clone() const
diff --git a/item/source/base/ItemControlBlock.cxx b/item/source/base/ItemControlBlock.cxx
index d1fdfe1d5053..38822aee0ea4 100755
--- a/item/source/base/ItemControlBlock.cxx
+++ b/item/source/base/ItemControlBlock.cxx
@@ -53,7 +53,7 @@ namespace Item
std::unique_ptr<const ItemBase> ItemControlBlock::createFromAny(const ItemBase::AnyIDArgs& rArgs)
{
ItemBase* pNewInstance(m_aConstructDefaultItem());
- pNewInstance->putValues(rArgs);
+ pNewInstance->putAnyValues(rArgs);
return std::unique_ptr<const ItemBase>(pNewInstance);
}
} // end of namespace Item
More information about the Libreoffice-commits
mailing list