summaryrefslogtreecommitdiff
path: root/include/svl
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@me.com>2019-04-18 19:25:06 +0200
committerArmin Le Grand <Armin.Le.Grand@me.com>2019-04-25 19:59:04 +0200
commit1e2682235cded9a7cd90e55f0bfc60a1285e9a46 (patch)
tree17457bc49d6faf37270c8a481b94765f58a5f434 /include/svl
parent5e4c1e6ba425ce0b75864e4584a846957b032e61 (diff)
WIP: Further preparations for deeper Item changes
(1) Migrated all still existing binary load/save stuff in SfxPoolItem to legacy files. Isolated from Item implementations. Adapted all usages. No more methods Create/Store needed, also GetVersion removed (2) Removed operator= for SfxPoolItem. Adapted all usages. Goal ist to handle Items more as Objects ('Object-Oriented') in the sense to move/handle instances, not to copy one instance over another one (which is more and more problematic with hard to copy content as UNO API stuff or similar). This lead to much more usages of std::shared_ptr which correlates well with future plans fr Items (see dev branch). Next logic step will be to also remove copy constructor Linux build and corrections done Fixed Writer test and removed unused defines Fixed another unused m,acro Started to unify the AutoFormat stuff Changes to OUString constructor usages, tests completely No idea why, but SfxStringItem constructor which takes a OUString& now insists of not getting ::OUString's handed in - changed all 'SfxStringItem.*OUString.*".*"' accordingly Change-Id: Ibed7358b18fb019994a7490332b9d797a6694c29 Reviewed-on: https://gerrit.libreoffice.org/71075 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'include/svl')
-rw-r--r--include/svl/aeitem.hxx6
-rw-r--r--include/svl/cintitem.hxx22
-rw-r--r--include/svl/eitem.hxx19
-rw-r--r--include/svl/flagitem.hxx2
-rw-r--r--include/svl/int64item.hxx5
-rw-r--r--include/svl/intitem.hxx26
-rw-r--r--include/svl/lckbitem.hxx3
-rwxr-xr-xinclude/svl/legacyitem.hxx52
-rw-r--r--include/svl/macitem.hxx1
-rw-r--r--include/svl/poolitem.hxx4
-rw-r--r--include/svl/ptitem.hxx2
-rw-r--r--include/svl/rectitem.hxx2
-rw-r--r--include/svl/rngitem.hxx2
-rw-r--r--include/svl/slstitm.hxx3
-rw-r--r--include/svl/stritem.hxx6
-rw-r--r--include/svl/visitem.hxx6
16 files changed, 52 insertions, 109 deletions
diff --git a/include/svl/aeitem.hxx b/include/svl/aeitem.hxx
index d69b1f086f4b..621468f32988 100644
--- a/include/svl/aeitem.hxx
+++ b/include/svl/aeitem.hxx
@@ -33,10 +33,6 @@ protected:
explicit SfxAllEnumItem_Base(sal_uInt16 nWhich, sal_uInt16 nValue):
SfxEnumItem(nWhich, nValue)
{}
-
- explicit SfxAllEnumItem_Base(sal_uInt16 const nWhich, SvStream & rStream):
- SfxEnumItem(nWhich, rStream)
- {}
};
class SVL_DLLPUBLIC SfxAllEnumItem: public SfxAllEnumItem_Base
@@ -49,7 +45,6 @@ class SVL_DLLPUBLIC SfxAllEnumItem: public SfxAllEnumItem_Base
public:
explicit SfxAllEnumItem( sal_uInt16 nWhich);
SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal );
- SfxAllEnumItem( sal_uInt16 nWhich, SvStream &rStream );
SfxAllEnumItem( const SfxAllEnumItem & );
virtual ~SfxAllEnumItem() override;
@@ -61,7 +56,6 @@ public:
sal_uInt16 GetValueByPos( sal_uInt16 nPos ) const;
OUString const & GetValueTextByPos( sal_uInt16 nPos ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
- virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const override;
};
#endif
diff --git a/include/svl/cintitem.hxx b/include/svl/cintitem.hxx
index f8e1ea3f0fa3..5176d150629c 100644
--- a/include/svl/cintitem.hxx
+++ b/include/svl/cintitem.hxx
@@ -47,10 +47,6 @@ public:
virtual bool PutValue(const css::uno::Any& rVal,
sal_uInt8 nMemberId) override;
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override;
-
- virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override;
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
sal_uInt8 GetValue() const { return m_nValue; }
@@ -74,8 +70,6 @@ public:
SfxPoolItem(which), m_nValue(nTheValue)
{}
- CntUInt16Item(sal_uInt16 which, SvStream & rStream);
-
virtual bool operator ==(const SfxPoolItem & rItem) const override;
virtual bool GetPresentation(SfxItemPresentation,
@@ -90,10 +84,6 @@ public:
virtual bool PutValue(const css::uno::Any& rVal,
sal_uInt8 nMemberId) override;
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override;
-
- virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override;
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
sal_uInt16 GetValue() const { return m_nValue; }
@@ -117,8 +107,6 @@ public:
SfxPoolItem(which), m_nValue(nTheValue)
{}
- CntInt32Item(sal_uInt16 which, SvStream & rStream);
-
virtual bool operator ==(const SfxPoolItem & rItem) const override;
virtual bool GetPresentation(SfxItemPresentation,
@@ -133,10 +121,6 @@ public:
virtual bool PutValue(const css::uno::Any& rVal,
sal_uInt8 nMemberId) override;
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override;
-
- virtual SvStream & Store(SvStream &, sal_uInt16) const override;
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
sal_Int32 GetValue() const { return m_nValue; }
@@ -160,8 +144,6 @@ public:
SfxPoolItem(which), m_nValue(nTheValue)
{}
- CntUInt32Item(sal_uInt16 nWhich, SvStream & rStream);
-
virtual bool operator ==(const SfxPoolItem & rItem) const override;
virtual bool GetPresentation(SfxItemPresentation,
@@ -176,10 +158,6 @@ public:
virtual bool PutValue(const css::uno::Any& rVal,
sal_uInt8 nMemberId) override;
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override;
-
- virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override;
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
sal_uInt32 GetValue() const { return m_nValue; }
diff --git a/include/svl/eitem.hxx b/include/svl/eitem.hxx
index 268df41d6f4a..eadf1321b8a9 100644
--- a/include/svl/eitem.hxx
+++ b/include/svl/eitem.hxx
@@ -38,14 +38,6 @@ protected:
SfxEnumItem(const SfxEnumItem &) = default;
- SfxEnumItem(sal_uInt16 const nWhich, SvStream & rStream)
- : SfxEnumItemInterface(nWhich)
- {
- sal_uInt16 nTmp = 0;
- rStream.ReadUInt16( nTmp );
- m_nValue = static_cast<EnumT>(nTmp);
- }
-
public:
EnumT GetValue() const { return m_nValue; }
@@ -56,12 +48,6 @@ public:
m_nValue = nTheValue;
}
- virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override
- {
- rStream.WriteUInt16( static_cast<sal_uInt16>(m_nValue) );
- return rStream;
- }
-
virtual sal_uInt16 GetEnumValue() const override
{
return static_cast<sal_uInt16>(GetValue());
@@ -114,11 +100,6 @@ public:
virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8) override;
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
- override;
-
- virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override;
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
virtual OUString GetValueTextByVal(bool bTheValue) const;
diff --git a/include/svl/flagitem.hxx b/include/svl/flagitem.hxx
index f37a9e5ef548..db061e38c326 100644
--- a/include/svl/flagitem.hxx
+++ b/include/svl/flagitem.hxx
@@ -36,8 +36,6 @@ public:
virtual sal_uInt8 GetFlagCount() const;
virtual bool operator==( const SfxPoolItem& ) const override;
- virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const override;
- virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const override;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
virtual bool GetPresentation( SfxItemPresentation ePres,
diff --git a/include/svl/int64item.hxx b/include/svl/int64item.hxx
index 410beb21746b..428381b340a5 100644
--- a/include/svl/int64item.hxx
+++ b/include/svl/int64item.hxx
@@ -19,7 +19,6 @@ class SVL_DLLPUBLIC SfxInt64Item : public SfxPoolItem
public:
SfxInt64Item( sal_uInt16 nWhich, sal_Int64 nVal );
- SfxInt64Item( sal_uInt16 nWhich, SvStream & rStream );
virtual ~SfxInt64Item() override;
@@ -40,10 +39,6 @@ public:
virtual bool PutValue(
const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
- virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nItemVersion ) const override;
-
- virtual SvStream& Store( SvStream& rStream, sal_uInt16 nItemVersion ) const override;
-
virtual SfxPoolItem* Clone( SfxItemPool* pOther = nullptr ) const override;
sal_Int64 GetValue() const { return mnValue;}
diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx
index a4c14ebd863f..f6064ed8a335 100644
--- a/include/svl/intitem.hxx
+++ b/include/svl/intitem.hxx
@@ -32,8 +32,6 @@ public:
explicit SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0):
CntByteItem(which, nValue) {}
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override;
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override
{ return new SfxByteItem(*this); }
};
@@ -49,8 +47,6 @@ public:
SfxPoolItem(which), m_nValue(nTheValue)
{}
- SfxInt16Item(sal_uInt16 nWhich, SvStream & rStream);
-
virtual bool operator ==(const SfxPoolItem & rItem) const override;
virtual bool GetPresentation(SfxItemPresentation,
@@ -65,10 +61,6 @@ public:
virtual bool PutValue( const css::uno::Any& rVal,
sal_uInt8 nMemberId ) override;
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override;
-
- virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override;
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
sal_Int16 GetValue() const { return m_nValue; }
@@ -91,12 +83,6 @@ public:
explicit SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
CntUInt16Item(which, nValue) {}
- SfxUInt16Item(sal_uInt16 which, SvStream & rStream):
- CntUInt16Item(which, rStream) {}
-
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override
- { return new SfxUInt16Item(Which(), rStream); }
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override
{ return new SfxUInt16Item(*this); }
@@ -112,12 +98,6 @@ public:
explicit SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0):
CntInt32Item(which, nValue) {}
- SfxInt32Item(sal_uInt16 which, SvStream & rStream):
- CntInt32Item(which, rStream) {}
-
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override
- { return new SfxInt32Item(Which(), rStream); }
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override
{ return new SfxInt32Item(*this); }
@@ -133,12 +113,6 @@ public:
explicit SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0):
CntUInt32Item(which, nValue) {}
- SfxUInt32Item(sal_uInt16 which, SvStream & rStream):
- CntUInt32Item(which, rStream) {}
-
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override
- { return new SfxUInt32Item(Which(), rStream); }
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override
{ return new SfxUInt32Item(*this); }
diff --git a/include/svl/lckbitem.hxx b/include/svl/lckbitem.hxx
index d6bf1a21e27c..331854a56d9a 100644
--- a/include/svl/lckbitem.hxx
+++ b/include/svl/lckbitem.hxx
@@ -30,7 +30,6 @@ class SVL_DLLPUBLIC SfxLockBytesItem : public SfxPoolItem
public:
static SfxPoolItem* CreateDefault();
SfxLockBytesItem();
- SfxLockBytesItem( sal_uInt16 nWhich, SvStream & );
virtual ~SfxLockBytesItem() override;
SfxLockBytesItem(SfxLockBytesItem const &) = default;
@@ -40,8 +39,6 @@ public:
virtual bool operator==( const SfxPoolItem& ) const override;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
- virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const override;
- virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const override;
SvLockBytes* GetValue() const { return _xVal.get(); }
diff --git a/include/svl/legacyitem.hxx b/include/svl/legacyitem.hxx
new file mode 100755
index 000000000000..b2035aecaf9b
--- /dev/null
+++ b/include/svl/legacyitem.hxx
@@ -0,0 +1,52 @@
+/* -*- 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_SVL_LEGACYITEM_HXX
+#define INCLUDED_SVL_LEGACYITEM_HXX
+
+#include <svl/svldllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// // svl
+// SfxBoolItem aLinebreak;
+// SfxInt32Item aRotateAngle; -> CntInt32Item
+//////////////////////////////////////////////////////////////////////////////
+
+class SvStream;
+class SfxBoolItem;
+class CntInt32Item;
+
+namespace legacy
+{
+ namespace SfxBool
+ {
+ sal_uInt16 SVL_DLLPUBLIC GetVersion(sal_uInt16 nFileFormatVersion);
+ void SVL_DLLPUBLIC Create(SfxBoolItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion);
+ SVL_DLLPUBLIC SvStream& Store(const SfxBoolItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion);
+ }
+ namespace CntInt32
+ {
+ sal_uInt16 SVL_DLLPUBLIC GetVersion(sal_uInt16 nFileFormatVersion);
+ void SVL_DLLPUBLIC Create(CntInt32Item& rItem, SvStream& rStrm, sal_uInt16 nItemVersion);
+ SVL_DLLPUBLIC SvStream& Store(const CntInt32Item& rItem, SvStream& rStrm, sal_uInt16 nItemVersion);
+ }
+}
+
+#endif // INCLUDED_SVL_LEGACYITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/macitem.hxx b/include/svl/macitem.hxx
index 7d17b3349dd3..a397cc6e3bb4 100644
--- a/include/svl/macitem.hxx
+++ b/include/svl/macitem.hxx
@@ -125,7 +125,6 @@ public:
OUString &rText,
const IntlWrapper& ) const override;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
- virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const override;
const SvxMacroTableDtor& GetMacroTable() const { return aMacroTable;}
void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aMacroTable = rTbl; }
diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx
index c3800cc02c18..796d6aa476c9 100644
--- a/include/svl/poolitem.hxx
+++ b/include/svl/poolitem.hxx
@@ -31,7 +31,6 @@
#include <tools/mapunit.hxx>
class IntlWrapper;
-class SvStream;
enum class SfxItemKind : sal_Int8
{
@@ -164,15 +163,12 @@ public:
OUString &rText,
const IntlWrapper& rIntlWrapper ) const;
- virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
virtual void ScaleMetrics( long lMult, long lDiv );
virtual bool HasMetrics() const;
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId );
- virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nItemVersion ) const;
- virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const = 0;
// clone and call SetWhich
std::unique_ptr<SfxPoolItem> CloneSetWhich( sal_uInt16 nNewWhich ) const;
diff --git a/include/svl/ptitem.hxx b/include/svl/ptitem.hxx
index 76e5022c441b..348d427d763f 100644
--- a/include/svl/ptitem.hxx
+++ b/include/svl/ptitem.hxx
@@ -44,8 +44,6 @@ public:
virtual bool operator==( const SfxPoolItem& ) const override;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
- virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const override;
- virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const override;
const Point& GetValue() const { return aVal; }
void SetValue( const Point& rNewVal ) {
diff --git a/include/svl/rectitem.hxx b/include/svl/rectitem.hxx
index 3dd119e1d089..412a695be464 100644
--- a/include/svl/rectitem.hxx
+++ b/include/svl/rectitem.hxx
@@ -42,8 +42,6 @@ public:
virtual bool operator==( const SfxPoolItem& ) const override;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
- virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const override;
- virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const override;
const tools::Rectangle& GetValue() const { return aVal; }
virtual bool QueryValue( css::uno::Any& rVal,
diff --git a/include/svl/rngitem.hxx b/include/svl/rngitem.hxx
index 316b9c334f3d..de2d64d9c34c 100644
--- a/include/svl/rngitem.hxx
+++ b/include/svl/rngitem.hxx
@@ -41,8 +41,6 @@ public:
const IntlWrapper& ) const override;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
sal_uInt16& From() { return nFrom; }
- virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const override;
- virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const override;
};
diff --git a/include/svl/slstitm.hxx b/include/svl/slstitm.hxx
index dc803e69103d..872903f3c7d8 100644
--- a/include/svl/slstitm.hxx
+++ b/include/svl/slstitm.hxx
@@ -36,7 +36,6 @@ public:
SfxStringListItem();
SfxStringListItem( sal_uInt16 nWhich, const std::vector<OUString> *pList=nullptr );
- SfxStringListItem( sal_uInt16 nWhich, SvStream& rStream );
virtual ~SfxStringListItem() override;
SfxStringListItem(SfxStringListItem const &) = default;
@@ -62,8 +61,6 @@ public:
OUString &rText,
const IntlWrapper& ) const override;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
- virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const override;
- virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const override;
virtual bool PutValue ( const css::uno::Any& rVal,
sal_uInt8 nMemberId ) override;
diff --git a/include/svl/stritem.hxx b/include/svl/stritem.hxx
index 2103e917ee13..37546d88b4b2 100644
--- a/include/svl/stritem.hxx
+++ b/include/svl/stritem.hxx
@@ -34,12 +34,6 @@ public:
SfxStringItem(sal_uInt16 which, const OUString & rValue):
CntUnencodedStringItem(which, rValue) {}
- SfxStringItem(sal_uInt16 nWhich, SvStream & rStream);
-
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override;
-
- virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override;
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
diff --git a/include/svl/visitem.hxx b/include/svl/visitem.hxx
index af382c426bc3..f83274644fdb 100644
--- a/include/svl/visitem.hxx
+++ b/include/svl/visitem.hxx
@@ -36,8 +36,6 @@ public:
m_nValue.bVisible = bVisible;
}
- SfxVisibilityItem(sal_uInt16 which, SvStream & rStream);
-
virtual bool operator ==(const SfxPoolItem & rItem) const override;
virtual bool GetPresentation(SfxItemPresentation, MapUnit, MapUnit,
@@ -51,10 +49,6 @@ public:
virtual bool PutValue( const css::uno::Any& rVal,
sal_uInt8 nMemberId ) override;
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override;
-
- virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override;
-
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
bool GetValue() const { return m_nValue.bVisible; }