summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/Library_svx.mk2
-rw-r--r--svx/source/dialog/svxruler.cxx31
-rw-r--r--svx/source/engine3d/svx3ditems.cxx30
-rw-r--r--svx/source/items/algitem.cxx32
-rwxr-xr-xsvx/source/items/autoformathelper.cxx380
-rw-r--r--svx/source/items/chrtitem.cxx22
-rw-r--r--svx/source/items/customshapeitem.cxx5
-rw-r--r--svx/source/items/e3ditem.cxx5
-rwxr-xr-xsvx/source/items/legacyitem.cxx105
-rw-r--r--svx/source/items/rotmodit.cxx12
-rw-r--r--svx/source/svdraw/svdattr.cxx10
-rw-r--r--svx/source/unodraw/unobrushitemhelper.cxx18
-rw-r--r--svx/source/xoutdev/xattr.cxx20
-rw-r--r--svx/source/xoutdev/xattr2.cxx10
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx5
15 files changed, 514 insertions, 173 deletions
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 4677f3b475f4..6589179eb025 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -160,8 +160,10 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/dialog/txenctab \
svx/source/engine3d/float3d \
svx/source/items/algitem \
+ svx/source/items/autoformathelper \
svx/source/items/hlnkitem \
svx/source/items/numfmtsh \
+ svx/source/items/legacyitem \
svx/source/items/numinf \
svx/source/items/ofaitem \
svx/source/items/pageitem \
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 8141ec50b80f..04cd33c9d327 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -131,7 +131,7 @@ struct SvxRuler_Impl {
long lMaxRightLogic;
long lLastLMargin;
long lLastRMargin;
- SvxProtectItem aProtectItem;
+ std::unique_ptr<SvxProtectItem> aProtectItem;
std::unique_ptr<SfxBoolItem> pTextRTLItem;
sal_uInt16 nControlerItems;
sal_uInt16 nIdx;
@@ -148,7 +148,8 @@ struct SvxRuler_Impl {
SvxRuler_Impl() :
nPercSize(0), nTotalDist(0),
lOldWinPos(0), lMaxLeftLogic(0), lMaxRightLogic(0),
- lLastLMargin(0), lLastRMargin(0), aProtectItem(SID_RULER_PROTECT),
+ lLastLMargin(0), lLastRMargin(0),
+ aProtectItem(std::make_unique<SvxProtectItem>(SID_RULER_PROTECT)),
nControlerItems(0), nIdx(0),
nColLeftPix(0), nColRightPix(0),
bIsTableRows(false),
@@ -498,8 +499,8 @@ inline sal_uInt16 SvxRuler::GetObjectBordersOff(sal_uInt16 nIdx) const
void SvxRuler::UpdateFrame()
{
const RulerMarginStyle nMarginStyle =
- ( mxRulerImpl->aProtectItem.IsSizeProtected() ||
- mxRulerImpl->aProtectItem.IsPosProtected() ) ?
+ ( mxRulerImpl->aProtectItem->IsSizeProtected() ||
+ mxRulerImpl->aProtectItem->IsPosProtected() ) ?
RulerMarginStyle::NONE : RulerMarginStyle::Sizeable;
if(mxLRSpaceItem.get() && mxPagePosItem.get())
@@ -745,7 +746,7 @@ void SvxRuler::UpdateFrame(const SvxLongULSpaceItem *pItem) // new value
void SvxRuler::Update( const SvxProtectItem* pItem )
{
if( pItem )
- mxRulerImpl->aProtectItem = *pItem;
+ mxRulerImpl->aProtectItem.reset(static_cast<SvxProtectItem*>(pItem->Clone()));
}
void SvxRuler::UpdateTextRTL(const SfxBoolItem* pItem)
@@ -800,8 +801,8 @@ void SvxRuler::UpdateColumns()
RulerBorderStyle nStyleFlags = RulerBorderStyle::Variable;
bool bProtectColumns =
- mxRulerImpl->aProtectItem.IsSizeProtected() ||
- mxRulerImpl->aProtectItem.IsPosProtected();
+ mxRulerImpl->aProtectItem->IsSizeProtected() ||
+ mxRulerImpl->aProtectItem->IsPosProtected();
if( !bProtectColumns )
{
@@ -1392,8 +1393,8 @@ void SvxRuler::AdjustMargin1(long lInputDiff)
const long lDragPos = lInputDiff;
bool bProtectColumns =
- mxRulerImpl->aProtectItem.IsSizeProtected() ||
- mxRulerImpl->aProtectItem.IsPosProtected();
+ mxRulerImpl->aProtectItem->IsSizeProtected() ||
+ mxRulerImpl->aProtectItem->IsPosProtected();
const RulerMarginStyle nMarginStyle =
bProtectColumns ? RulerMarginStyle::NONE : RulerMarginStyle::Sizeable;
@@ -1524,8 +1525,8 @@ void SvxRuler::DragMargin2()
}
bool bProtectColumns =
- mxRulerImpl->aProtectItem.IsSizeProtected() ||
- mxRulerImpl->aProtectItem.IsPosProtected();
+ mxRulerImpl->aProtectItem->IsSizeProtected() ||
+ mxRulerImpl->aProtectItem->IsPosProtected();
const RulerMarginStyle nMarginStyle = bProtectColumns ? RulerMarginStyle::NONE : RulerMarginStyle::Sizeable;
@@ -2549,7 +2550,7 @@ void SvxRuler::Click()
if(mxTabStopItem.get() &&
(nFlags & SvxRulerSupportFlags::TABS) == SvxRulerSupportFlags::TABS)
{
- bool bContentProtected = mxRulerImpl->aProtectItem.IsContentProtected();
+ bool bContentProtected = mxRulerImpl->aProtectItem->IsContentProtected();
if( bContentProtected ) return;
const long lPos = GetClickPos();
if((bRTL && lPos < std::min(GetFirstLineIndent(), GetLeftIndent()) && lPos > GetRightIndent()) ||
@@ -2613,7 +2614,7 @@ void SvxRuler::CalcMinMax()
{
//top border is not moveable when table rows are displayed
// protection of content means the margin is not moveable
- if(bHorz && !mxRulerImpl->aProtectItem.IsContentProtected())
+ if(bHorz && !mxRulerImpl->aProtectItem->IsContentProtected())
{
nMaxLeft = mpBorders[0].nMinPos + lNullPix;
if(nDragType & SvxRulerDragFlags::OBJECT_SIZE_PROPORTIONAL)
@@ -2701,7 +2702,7 @@ void SvxRuler::CalcMinMax()
{
// get the bottom move range from the last border position - only available for rows!
// protection of content means the margin is not moveable
- if(bHorz || mxRulerImpl->aProtectItem.IsContentProtected())
+ if(bHorz || mxRulerImpl->aProtectItem->IsContentProtected())
{
nMaxLeft = nMaxRight = mpBorders[mxColumnItem->Count() - 1].nMaxPos + lNullPix;
}
@@ -3109,7 +3110,7 @@ bool SvxRuler::StartDrag()
<SvxRuler::CalcMinMax()>
<SvxRuler::EndDrag()>
*/
- bool bContentProtected = mxRulerImpl->aProtectItem.IsContentProtected();
+ bool bContentProtected = mxRulerImpl->aProtectItem->IsContentProtected();
if(!bValid)
return false;
diff --git a/svx/source/engine3d/svx3ditems.cxx b/svx/source/engine3d/svx3ditems.cxx
index 8b1efe4dfc44..8fe5b55948b0 100644
--- a/svx/source/engine3d/svx3ditems.cxx
+++ b/svx/source/engine3d/svx3ditems.cxx
@@ -35,11 +35,6 @@ Svx3DReducedLineGeometryItem::Svx3DReducedLineGeometryItem(bool bVal)
: SfxBoolItem(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY, bVal)
{}
-sal_uInt16 Svx3DReducedLineGeometryItem::GetVersion(sal_uInt16 /*nFileFormatVersion*/) const
-{
- return 1;
-}
-
SfxPoolItem * Svx3DReducedLineGeometryItem::Clone(SfxItemPool *) const
{
return new Svx3DReducedLineGeometryItem(*this);
@@ -78,11 +73,6 @@ Svx3DSmoothNormalsItem::Svx3DSmoothNormalsItem(bool bVal)
: SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_NORMALS, bVal)
{}
-sal_uInt16 Svx3DSmoothNormalsItem::GetVersion(sal_uInt16 /*nFileFormatVersion*/) const
-{
- return 1;
-}
-
SfxPoolItem * Svx3DSmoothNormalsItem::Clone(SfxItemPool *) const
{
return new Svx3DSmoothNormalsItem(*this);
@@ -93,11 +83,6 @@ Svx3DSmoothLidsItem::Svx3DSmoothLidsItem(bool bVal)
: SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_LIDS, bVal)
{}
-sal_uInt16 Svx3DSmoothLidsItem::GetVersion(sal_uInt16 /*nFileFormatVersion*/) const
-{
- return 1;
-}
-
SfxPoolItem * Svx3DSmoothLidsItem::Clone(SfxItemPool *) const
{
return new Svx3DSmoothLidsItem(*this);
@@ -108,11 +93,6 @@ Svx3DCharacterModeItem::Svx3DCharacterModeItem(bool bVal)
: SfxBoolItem(SDRATTR_3DOBJ_CHARACTER_MODE, bVal)
{}
-sal_uInt16 Svx3DCharacterModeItem::GetVersion(sal_uInt16 /*nFileFormatVersion*/) const
-{
- return 1;
-}
-
SfxPoolItem * Svx3DCharacterModeItem::Clone(SfxItemPool *) const
{
return new Svx3DCharacterModeItem(*this);
@@ -123,11 +103,6 @@ Svx3DCloseFrontItem::Svx3DCloseFrontItem(bool bVal)
: SfxBoolItem(SDRATTR_3DOBJ_CLOSE_FRONT, bVal)
{}
-sal_uInt16 Svx3DCloseFrontItem::GetVersion(sal_uInt16 /*nFileFormatVersion*/) const
-{
- return 1;
-}
-
SfxPoolItem * Svx3DCloseFrontItem::Clone(SfxItemPool *) const
{
return new Svx3DCloseFrontItem(*this);
@@ -138,11 +113,6 @@ Svx3DCloseBackItem::Svx3DCloseBackItem(bool bVal)
: SfxBoolItem(SDRATTR_3DOBJ_CLOSE_BACK, bVal)
{}
-sal_uInt16 Svx3DCloseBackItem::GetVersion(sal_uInt16 /*nFileFormatVersion*/) const
-{
- return 1;
-}
-
SfxPoolItem * Svx3DCloseBackItem::Clone(SfxItemPool *) const
{
return new Svx3DCloseBackItem(*this);
diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx
index 4d9a7baecebd..ef11c6a9408b 100644
--- a/svx/source/items/algitem.cxx
+++ b/svx/source/items/algitem.cxx
@@ -133,14 +133,6 @@ SfxPoolItem* SvxOrientationItem::Clone( SfxItemPool* ) const
}
-SfxPoolItem* SvxOrientationItem::Create( SvStream& rStream, sal_uInt16 ) const
-{
- sal_uInt16 nVal;
- rStream.ReadUInt16( nVal );
- return new SvxOrientationItem( static_cast<SvxCellOrientation>(nVal), Which() );
-}
-
-
sal_uInt16 SvxOrientationItem::GetValueCount() const
{
return static_cast<sal_uInt16>(SvxCellOrientation::Stacked) + 1; // last enum value + 1
@@ -256,30 +248,6 @@ SfxPoolItem* SvxMarginItem::Clone( SfxItemPool* ) const
}
-SfxPoolItem* SvxMarginItem::Create( SvStream& rStream, sal_uInt16 ) const
-{
- sal_Int16 nLeft;
- sal_Int16 nTop;
- sal_Int16 nRight;
- sal_Int16 nBottom;
- rStream.ReadInt16( nLeft );
- rStream.ReadInt16( nTop );
- rStream.ReadInt16( nRight );
- rStream.ReadInt16( nBottom );
- return new SvxMarginItem( nLeft, nTop, nRight, nBottom, Which() );
-}
-
-
-SvStream& SvxMarginItem::Store( SvStream &rStream, sal_uInt16 /*nItemVersion*/) const
-{
- rStream.WriteInt16( nLeftMargin );
- rStream.WriteInt16( nTopMargin );
- rStream.WriteInt16( nRightMargin );
- rStream.WriteInt16( nBottomMargin );
- return rStream;
-}
-
-
bool SvxMarginItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
diff --git a/svx/source/items/autoformathelper.cxx b/svx/source/items/autoformathelper.cxx
new file mode 100755
index 000000000000..1304ab0a25a6
--- /dev/null
+++ b/svx/source/items/autoformathelper.cxx
@@ -0,0 +1,380 @@
+/* -*- 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 .
+ */
+
+#include <svx/autoformathelper.hxx>
+#include <tools/stream.hxx>
+#include <svl/legacyitem.hxx>
+#include <editeng/legacyitem.hxx>
+#include <svx/legacyitem.hxx>
+#include <editeng/fontitem.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <editeng/wghtitem.hxx>
+#include <editeng/postitem.hxx>
+#include <editeng/udlnitem.hxx>
+#include <editeng/crossedoutitem.hxx>
+#include <editeng/contouritem.hxx>
+#include <editeng/shdditem.hxx>
+#include <editeng/colritem.hxx>
+#include <editeng/boxitem.hxx>
+#include <editeng/lineitem.hxx>
+#include <editeng/brushitem.hxx>
+#include <editeng/adjustitem.hxx>
+#include <editeng/justifyitem.hxx>
+#include <svl/eitem.hxx>
+#include <svx/algitem.hxx>
+#include <svl/intitem.hxx>
+#include <svx/rotmodit.hxx>
+#include <osl/thread.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+AutoFormatVersions::AutoFormatVersions()
+: nFontVersion(0),
+ nFontHeightVersion(0),
+ nWeightVersion(0),
+ nPostureVersion(0),
+ nUnderlineVersion(0),
+ nOverlineVersion(0),
+ nCrossedOutVersion(0),
+ nContourVersion(0),
+ nShadowedVersion(0),
+ nColorVersion(0),
+ nBoxVersion(0),
+ nLineVersion(0),
+ nBrushVersion(0),
+ nAdjustVersion(0),
+ nHorJustifyVersion(0),
+ nVerJustifyVersion(0),
+ nOrientationVersion(0),
+ nMarginVersion(0),
+ nBoolVersion(0),
+ nInt32Version(0),
+ nRotateModeVersion(0),
+ nNumFormatVersion(0)
+{
+}
+
+const sal_uInt16 AUTOFORMAT_ID_300OVRLN = 10031;
+const sal_uInt16 AUTOFORMAT_ID_680DR14 = 10011;
+const sal_uInt16 AUTOFORMAT_ID_504 = 9801;
+
+void AutoFormatVersions::LoadBlockA( SvStream& rStream, sal_uInt16 nVer )
+{
+ rStream.ReadUInt16( nFontVersion );
+ rStream.ReadUInt16( nFontHeightVersion );
+ rStream.ReadUInt16( nWeightVersion );
+ rStream.ReadUInt16( nPostureVersion );
+ rStream.ReadUInt16( nUnderlineVersion );
+ if ( nVer >= AUTOFORMAT_ID_300OVRLN )
+ rStream.ReadUInt16( nOverlineVersion );
+ rStream.ReadUInt16( nCrossedOutVersion );
+ rStream.ReadUInt16( nContourVersion );
+ rStream.ReadUInt16( nShadowedVersion );
+ rStream.ReadUInt16( nColorVersion );
+ rStream.ReadUInt16( nBoxVersion );
+ if ( nVer >= AUTOFORMAT_ID_680DR14 )
+ rStream.ReadUInt16( nLineVersion );
+ rStream.ReadUInt16( nBrushVersion );
+ rStream.ReadUInt16( nAdjustVersion );
+}
+
+void AutoFormatVersions::LoadBlockB( SvStream& rStream, sal_uInt16 nVer )
+{
+ rStream.ReadUInt16( nHorJustifyVersion );
+ rStream.ReadUInt16( nVerJustifyVersion );
+ rStream.ReadUInt16( nOrientationVersion );
+ rStream.ReadUInt16( nMarginVersion );
+ rStream.ReadUInt16( nBoolVersion );
+ if ( nVer >= AUTOFORMAT_ID_504 )
+ {
+ rStream.ReadUInt16( nInt32Version );
+ rStream.ReadUInt16( nRotateModeVersion );
+ }
+ rStream.ReadUInt16( nNumFormatVersion );
+}
+
+void AutoFormatVersions::WriteBlockA(SvStream& rStream, sal_uInt16 fileVersion)
+{
+ rStream.WriteUInt16(legacy::SvxFont::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxFontHeight::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxWeight::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxPosture::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxTextLine::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxTextLine::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxCrossedOut::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SfxBool::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SfxBool::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxColor::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxBox::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxLine::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxBrush::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxAdjust::GetVersion(fileVersion));
+}
+
+void AutoFormatVersions::WriteBlockB(SvStream& rStream, sal_uInt16 fileVersion)
+{
+ rStream.WriteUInt16(legacy::SvxHorJustify::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxVerJustify::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxOrientation::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxMargin::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SfxBool::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::CntInt32::GetVersion(fileVersion));
+ rStream.WriteUInt16(legacy::SvxRotateMode::GetVersion(fileVersion));
+ rStream.WriteUInt16( 0 ); // NumberFormat
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+void AutoFormatBase::SetFont( const SvxFontItem& rNew ) { m_aFont.reset(static_cast<SvxFontItem*>(rNew.Clone())); }
+void AutoFormatBase::SetHeight( const SvxFontHeightItem& rNew ) { m_aHeight.reset(static_cast<SvxFontHeightItem*>(rNew.Clone())); }
+void AutoFormatBase::SetWeight( const SvxWeightItem& rNew ) { m_aWeight.reset(static_cast<SvxWeightItem*>(rNew.Clone())); }
+void AutoFormatBase::SetPosture( const SvxPostureItem& rNew ) { m_aPosture.reset(static_cast<SvxPostureItem*>(rNew.Clone())); }
+void AutoFormatBase::SetCJKFont( const SvxFontItem& rNew ) { m_aCJKFont.reset(static_cast<SvxFontItem*>(rNew.Clone())); }
+void AutoFormatBase::SetCJKHeight( const SvxFontHeightItem& rNew ) { m_aCJKHeight.reset(static_cast<SvxFontHeightItem*>(rNew.Clone())); }
+void AutoFormatBase::SetCJKWeight( const SvxWeightItem& rNew ) { m_aCJKWeight.reset(static_cast<SvxWeightItem*>(rNew.Clone())); }
+void AutoFormatBase::SetCJKPosture( const SvxPostureItem& rNew ) { m_aCJKPosture.reset(static_cast<SvxPostureItem*>(rNew.Clone())); }
+void AutoFormatBase::SetCTLFont( const SvxFontItem& rNew ) { m_aCTLFont.reset(static_cast<SvxFontItem*>(rNew.Clone())); }
+void AutoFormatBase::SetCTLHeight( const SvxFontHeightItem& rNew ) { m_aCTLHeight.reset(static_cast<SvxFontHeightItem*>(rNew.Clone())); }
+void AutoFormatBase::SetCTLWeight( const SvxWeightItem& rNew ) { m_aCTLWeight.reset(static_cast<SvxWeightItem*>(rNew.Clone())); }
+void AutoFormatBase::SetCTLPosture( const SvxPostureItem& rNew ) { m_aCTLPosture.reset(static_cast<SvxPostureItem*>(rNew.Clone())); }
+void AutoFormatBase::SetUnderline( const SvxUnderlineItem& rNew ) { m_aUnderline.reset(static_cast<SvxUnderlineItem*>(rNew.Clone())); }
+void AutoFormatBase::SetOverline( const SvxOverlineItem& rNew ) { m_aOverline.reset(static_cast<SvxOverlineItem*>(rNew.Clone())); }
+void AutoFormatBase::SetCrossedOut( const SvxCrossedOutItem& rNew ) { m_aCrossedOut.reset(static_cast<SvxCrossedOutItem*>(rNew.Clone())); }
+void AutoFormatBase::SetContour( const SvxContourItem& rNew ) { m_aContour.reset(static_cast<SvxContourItem*>(rNew.Clone())); }
+void AutoFormatBase::SetShadowed( const SvxShadowedItem& rNew ) { m_aShadowed.reset(static_cast<SvxShadowedItem*>(rNew.Clone())); }
+void AutoFormatBase::SetColor( const SvxColorItem& rNew ) { m_aColor.reset(static_cast<SvxColorItem*>(rNew.Clone())); }
+void AutoFormatBase::SetBox( const SvxBoxItem& rNew ) { m_aBox.reset(static_cast<SvxBoxItem*>(rNew.Clone())); }
+void AutoFormatBase::SetTLBR( const SvxLineItem& rNew ) { m_aTLBR.reset(static_cast<SvxLineItem*>(rNew.Clone())); }
+void AutoFormatBase::SetBLTR( const SvxLineItem& rNew ) { m_aBLTR.reset(static_cast<SvxLineItem*>(rNew.Clone())); }
+void AutoFormatBase::SetBackground( const SvxBrushItem& rNew ) { m_aBackground.reset(static_cast<SvxBrushItem*>(rNew.Clone())); }
+void AutoFormatBase::SetAdjust( const SvxAdjustItem& rNew ) { m_aAdjust.reset(static_cast<SvxAdjustItem*>(rNew.Clone())); }
+void AutoFormatBase::SetHorJustify( const SvxHorJustifyItem& rNew ) { m_aHorJustify.reset(static_cast<SvxHorJustifyItem*>(rNew.Clone())); }
+void AutoFormatBase::SetVerJustify( const SvxVerJustifyItem& rNew ) { m_aVerJustify.reset(static_cast<SvxVerJustifyItem*>(rNew.Clone())); }
+void AutoFormatBase::SetStacked( const SfxBoolItem& rNew ) { m_aStacked.reset(static_cast<SfxBoolItem*>(rNew.Clone())); }
+void AutoFormatBase::SetMargin( const SvxMarginItem& rNew ) { m_aMargin.reset(static_cast<SvxMarginItem*>(rNew.Clone())); }
+void AutoFormatBase::SetLinebreak( const SfxBoolItem& rNew ) { m_aLinebreak.reset(static_cast<SfxBoolItem*>(rNew.Clone())); }
+void AutoFormatBase::SetRotateAngle( const SfxInt32Item& rNew ) { m_aRotateAngle.reset(static_cast<SfxInt32Item*>(rNew.Clone())); }
+void AutoFormatBase::SetRotateMode( const SvxRotateModeItem& rNew ) { m_aRotateMode.reset(static_cast<SvxRotateModeItem*>(rNew.Clone())); }
+
+AutoFormatBase::AutoFormatBase()
+: m_aFont(),
+ m_aHeight(),
+ m_aWeight(),
+ m_aPosture(),
+ m_aCJKFont(),
+ m_aCJKHeight(),
+ m_aCJKWeight(),
+ m_aCJKPosture(),
+ m_aCTLFont(),
+ m_aCTLHeight(),
+ m_aCTLWeight(),
+ m_aCTLPosture(),
+ m_aUnderline(),
+ m_aOverline(),
+ m_aCrossedOut(),
+ m_aContour(),
+ m_aShadowed(),
+ m_aColor(),
+ m_aBox(),
+ m_aTLBR(),
+ m_aBLTR(),
+ m_aBackground(),
+ m_aAdjust(),
+ m_aHorJustify(),
+ m_aVerJustify(),
+ m_aStacked(),
+ m_aMargin(),
+ m_aLinebreak(),
+ m_aRotateAngle(),
+ m_aRotateMode()
+{
+}
+
+AutoFormatBase::AutoFormatBase( const AutoFormatBase& rNew )
+: m_aFont(static_cast<SvxFontItem*>(rNew.m_aFont->Clone())),
+ m_aHeight(static_cast<SvxFontHeightItem*>(rNew.m_aHeight->Clone())),
+ m_aWeight(static_cast<SvxWeightItem*>(rNew.m_aWeight->Clone())),
+ m_aPosture(static_cast<SvxPostureItem*>(rNew.m_aPosture->Clone())),
+ m_aCJKFont(static_cast<SvxFontItem*>(rNew.m_aCJKFont->Clone())),
+ m_aCJKHeight(static_cast<SvxFontHeightItem*>(rNew.m_aCJKHeight->Clone())),
+ m_aCJKWeight(static_cast<SvxWeightItem*>(rNew.m_aCJKWeight->Clone())),
+ m_aCJKPosture(static_cast<SvxPostureItem*>(rNew.m_aCJKPosture->Clone())),
+ m_aCTLFont(static_cast<SvxFontItem*>(rNew.m_aCTLFont->Clone())),
+ m_aCTLHeight(static_cast<SvxFontHeightItem*>(rNew.m_aCTLHeight->Clone())),
+ m_aCTLWeight(static_cast<SvxWeightItem*>(rNew.m_aCTLWeight->Clone())),
+ m_aCTLPosture(static_cast<SvxPostureItem*>(rNew.m_aCTLPosture->Clone())),
+ m_aUnderline(static_cast<SvxUnderlineItem*>(rNew.m_aUnderline->Clone())),
+ m_aOverline(static_cast<SvxOverlineItem*>(rNew.m_aOverline->Clone())),
+ m_aCrossedOut(static_cast<SvxCrossedOutItem*>(rNew.m_aCrossedOut->Clone())),
+ m_aContour(static_cast<SvxContourItem*>(rNew.m_aContour->Clone())),
+ m_aShadowed(static_cast<SvxShadowedItem*>(rNew.m_aShadowed->Clone())),
+ m_aColor(static_cast<SvxColorItem*>(rNew.m_aColor->Clone())),
+ m_aBox(static_cast<SvxBoxItem*>(rNew.m_aBox->Clone())),
+ m_aTLBR(static_cast<SvxLineItem*>(rNew.m_aTLBR->Clone())),
+ m_aBLTR(static_cast<SvxLineItem*>(rNew.m_aBLTR->Clone())),
+ m_aBackground(static_cast<SvxBrushItem*>(rNew.m_aBackground->Clone())),
+ m_aAdjust(static_cast<SvxAdjustItem*>(rNew.m_aAdjust->Clone())),
+ m_aHorJustify(static_cast<SvxHorJustifyItem*>(rNew.m_aHorJustify->Clone())),
+ m_aVerJustify(static_cast<SvxVerJustifyItem*>(rNew.m_aVerJustify->Clone())),
+ m_aStacked(static_cast<SfxBoolItem*>(rNew.m_aStacked->Clone())),
+ m_aMargin(static_cast<SvxMarginItem*>(rNew.m_aMargin->Clone())),
+ m_aLinebreak(static_cast<SfxBoolItem*>(rNew.m_aLinebreak->Clone())),
+ m_aRotateAngle(static_cast<SfxInt32Item*>(rNew.m_aRotateAngle->Clone())),
+ m_aRotateMode(static_cast<SvxRotateModeItem*>(rNew.m_aRotateMode->Clone()))
+{
+}
+
+AutoFormatBase::~AutoFormatBase()
+{
+}
+
+const sal_uInt16 AUTOFORMAT_DATA_ID_641 = 10002;
+const sal_uInt16 AUTOFORMAT_DATA_ID_300OVRLN = 10032;
+const sal_uInt16 AUTOFORMAT_DATA_ID_680DR14 = 10012;
+const sal_uInt16 AUTOFORMAT_DATA_ID_504 = 9802;
+
+bool AutoFormatBase::LoadBlockA( SvStream& rStream, const AutoFormatVersions& rVersions, sal_uInt16 nVer )
+{
+ legacy::SvxFont::Create(*m_aFont, rStream, rVersions.nFontVersion);
+
+ if( rStream.GetStreamCharSet() == m_aFont->GetCharSet() )
+ {
+ m_aFont->SetCharSet(::osl_getThreadTextEncoding());
+ }
+
+ legacy::SvxFontHeight::Create(*m_aHeight, rStream, rVersions.nFontHeightVersion);
+ legacy::SvxWeight::Create(*m_aWeight, rStream, rVersions.nWeightVersion);
+ legacy::SvxPosture::Create(*m_aPosture, rStream, rVersions.nPostureVersion);
+
+ // --- from 641 on: CJK and CTL font settings
+ if( AUTOFORMAT_DATA_ID_641 <= nVer )
+ {
+ legacy::SvxFont::Create(*m_aCJKFont, rStream, rVersions.nFontVersion);
+ legacy::SvxFontHeight::Create(*m_aCJKHeight, rStream, rVersions.nFontHeightVersion);
+ legacy::SvxWeight::Create(*m_aCJKWeight, rStream, rVersions.nWeightVersion);
+ legacy::SvxPosture::Create(*m_aCJKPosture, rStream, rVersions.nPostureVersion);
+
+ legacy::SvxFont::Create(*m_aCTLFont, rStream, rVersions.nFontVersion);
+ legacy::SvxFontHeight::Create(*m_aCTLHeight, rStream, rVersions.nFontHeightVersion);
+ legacy::SvxWeight::Create(*m_aCTLWeight, rStream, rVersions.nWeightVersion);
+ legacy::SvxPosture::Create(*m_aCTLPosture, rStream, rVersions.nPostureVersion);
+ }
+
+ legacy::SvxTextLine::Create(*m_aUnderline, rStream, rVersions.nUnderlineVersion);
+
+ if( nVer >= AUTOFORMAT_DATA_ID_300OVRLN )
+ {
+ legacy::SvxTextLine::Create(*m_aOverline, rStream, rVersions.nOverlineVersion);
+ }
+
+ legacy::SvxCrossedOut::Create(*m_aCrossedOut, rStream, rVersions.nCrossedOutVersion);
+ legacy::SfxBool::Create(*m_aContour, rStream, rVersions.nContourVersion);
+ legacy::SfxBool::Create(*m_aShadowed, rStream, rVersions.nShadowedVersion);
+ legacy::SvxColor::Create(*m_aColor, rStream, rVersions.nColorVersion);
+ legacy::SvxBox::Create(*m_aBox, rStream, rVersions.nBoxVersion);
+
+ // --- from 680/dr14 on: diagonal frame lines
+ if( nVer >= AUTOFORMAT_DATA_ID_680DR14 )
+ {
+ legacy::SvxLine::Create(*m_aTLBR, rStream, rVersions.nLineVersion);
+ legacy::SvxLine::Create(*m_aBLTR, rStream, rVersions.nLineVersion);
+ }
+
+ legacy::SvxBrush::Create(*m_aBackground, rStream, rVersions.nBrushVersion);
+ legacy::SvxAdjust::Create(*m_aAdjust, rStream, rVersions.nAdjustVersion);
+
+ return ERRCODE_NONE == rStream.GetError();
+}
+
+bool AutoFormatBase::LoadBlockB( SvStream& rStream, const AutoFormatVersions& rVersions, sal_uInt16 nVer )
+{
+ legacy::SvxHorJustify::Create(*m_aHorJustify, rStream, rVersions.nHorJustifyVersion);
+ legacy::SvxVerJustify::Create(*m_aVerJustify, rStream, rVersions.nVerJustifyVersion);
+ SvxOrientationItem aOrientation( SvxCellOrientation::Standard, 0);
+ legacy::SvxOrientation::Create(aOrientation, rStream, rVersions.nOrientationVersion);
+ legacy::SvxMargin::Create(*m_aMargin, rStream, rVersions.nMarginVersion);
+ legacy::SfxBool::Create(*m_aLinebreak, rStream, rVersions.nBoolVersion);
+
+ if ( nVer >= AUTOFORMAT_DATA_ID_504 )
+ {
+ legacy::CntInt32::Create(*m_aRotateAngle, rStream, rVersions.nInt32Version);
+ legacy::SvxRotateMode::Create(*m_aRotateMode, rStream, rVersions.nRotateModeVersion);
+ }
+
+ m_aStacked->SetValue( aOrientation.IsStacked() );
+ m_aRotateAngle->SetValue( aOrientation.GetRotation( m_aRotateAngle->GetValue() ) );
+
+ return ERRCODE_NONE == rStream.GetError();
+}
+
+bool AutoFormatBase::SaveBlockA( SvStream& rStream, sal_uInt16 fileVersion ) const
+{
+ legacy::SvxFont::Store(*m_aFont, rStream, legacy::SvxFont::GetVersion(fileVersion));
+ legacy::SvxFontHeight::Store(*m_aHeight, rStream, legacy::SvxFontHeight::GetVersion(fileVersion));
+ legacy::SvxWeight::Store(*m_aWeight, rStream, legacy::SvxWeight::GetVersion(fileVersion));
+ legacy::SvxPosture::Store(*m_aPosture, rStream, legacy::SvxPosture::GetVersion(fileVersion));
+
+ // --- from 641 on: CJK and CTL font settings
+ legacy::SvxFont::Store(*m_aCJKFont, rStream, legacy::SvxFont::GetVersion(fileVersion));
+ legacy::SvxFontHeight::Store(*m_aCJKHeight, rStream, legacy::SvxFontHeight::GetVersion(fileVersion));
+ legacy::SvxWeight::Store(*m_aCJKWeight, rStream, legacy::SvxWeight::GetVersion(fileVersion));
+ legacy::SvxPosture::Store(*m_aCJKPosture, rStream, legacy::SvxPosture::GetVersion(fileVersion));
+
+ legacy::SvxFont::Store(*m_aCTLFont, rStream, legacy::SvxFont::GetVersion(fileVersion));
+ legacy::SvxFontHeight::Store(*m_aCTLHeight, rStream, legacy::SvxFontHeight::GetVersion(fileVersion));
+ legacy::SvxWeight::Store(*m_aCTLWeight, rStream, legacy::SvxWeight::GetVersion(fileVersion));
+ legacy::SvxPosture::Store(*m_aCTLPosture, rStream, legacy::SvxPosture::GetVersion(fileVersion));
+
+ legacy::SvxTextLine::Store(*m_aUnderline, rStream, legacy::SvxTextLine::GetVersion(fileVersion));
+
+ // --- from DEV300/overline2 on: overline support
+ legacy::SvxTextLine::Store(*m_aOverline, rStream, legacy::SvxTextLine::GetVersion(fileVersion));
+ legacy::SvxCrossedOut::Store(*m_aCrossedOut, rStream, legacy::SvxCrossedOut::GetVersion(fileVersion));
+ legacy::SfxBool::Store(*m_aContour, rStream, legacy::SfxBool::GetVersion(fileVersion));
+ legacy::SfxBool::Store(*m_aShadowed, rStream, legacy::SfxBool::GetVersion(fileVersion));
+ legacy::SvxColor::Store(*m_aColor, rStream, legacy::SvxColor::GetVersion(fileVersion));
+ legacy::SvxBox::Store(*m_aBox, rStream, legacy::SvxBox::GetVersion(fileVersion));
+
+ // --- from 680/dr14 on: diagonal frame lines
+ legacy::SvxLine::Store(*m_aTLBR, rStream, legacy::SvxLine::GetVersion(fileVersion));
+ legacy::SvxLine::Store(*m_aBLTR, rStream, legacy::SvxLine::GetVersion(fileVersion));
+ legacy::SvxBrush::Store(*m_aBackground, rStream, legacy::SvxBrush::GetVersion(fileVersion));
+ legacy::SvxAdjust::Store(*m_aAdjust, rStream, legacy::SvxAdjust::GetVersion(fileVersion));
+
+ return ERRCODE_NONE == rStream.GetError();
+}
+
+bool AutoFormatBase::SaveBlockB( SvStream& rStream, sal_uInt16 fileVersion ) const
+{
+ legacy::SvxHorJustify::Store(*m_aHorJustify, rStream, legacy::SvxHorJustify::GetVersion(fileVersion));
+ legacy::SvxVerJustify::Store(*m_aVerJustify, rStream, legacy::SvxVerJustify::GetVersion(fileVersion));
+ SvxOrientationItem aOrientation( m_aRotateAngle->GetValue(), m_aStacked->GetValue(), 0 );
+ legacy::SvxOrientation::Store(aOrientation, rStream, legacy::SvxOrientation::GetVersion(fileVersion));
+ legacy::SvxMargin::Store(*m_aMargin, rStream, legacy::SvxMargin::GetVersion(fileVersion));
+ legacy::SfxBool::Store(*m_aLinebreak, rStream, legacy::SfxBool::GetVersion(fileVersion));
+
+ // Calc Rotation from SO5
+ legacy::CntInt32::Store(*m_aRotateAngle, rStream, legacy::CntInt32::GetVersion(fileVersion));
+ legacy::SvxRotateMode::Store(*m_aRotateMode, rStream, legacy::SvxRotateMode::GetVersion(fileVersion));
+
+ return ERRCODE_NONE == rStream.GetError();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx
index f4479727fa9b..5c128c6806a9 100644
--- a/svx/source/items/chrtitem.cxx
+++ b/svx/source/items/chrtitem.cxx
@@ -162,13 +162,6 @@ SfxPoolItem* SvxChartKindErrorItem::Clone(SfxItemPool* /*pPool*/) const
}
-sal_uInt16 SvxChartKindErrorItem::GetVersion (sal_uInt16 nFileFormatVersion) const
-{
- return (nFileFormatVersion == SOFFICE_FILEFORMAT_31)
- ? USHRT_MAX
- : 0;
-}
-
SvxChartIndicateItem::SvxChartIndicateItem(SvxChartIndicate eOrient,
sal_uInt16 nId) :
SfxEnumItem(nId, eOrient)
@@ -182,13 +175,6 @@ SfxPoolItem* SvxChartIndicateItem::Clone(SfxItemPool* /*pPool*/) const
}
-sal_uInt16 SvxChartIndicateItem::GetVersion (sal_uInt16 nFileFormatVersion) const
-{
- return (nFileFormatVersion == SOFFICE_FILEFORMAT_31)
- ? USHRT_MAX
- : 0;
-}
-
SvxChartRegressItem::SvxChartRegressItem(SvxChartRegress eOrient,
sal_uInt16 nId) :
SfxEnumItem(nId, eOrient)
@@ -202,12 +188,4 @@ SfxPoolItem* SvxChartRegressItem::Clone(SfxItemPool* /*pPool*/) const
}
-sal_uInt16 SvxChartRegressItem::GetVersion (sal_uInt16 nFileFormatVersion) const
-{
- return (nFileFormatVersion == SOFFICE_FILEFORMAT_31)
- ? USHRT_MAX
- : 0;
-}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx
index fba55040dc37..329c2f09b7e0 100644
--- a/svx/source/items/customshapeitem.cxx
+++ b/svx/source/items/customshapeitem.cxx
@@ -265,15 +265,12 @@ SfxPoolItem* SdrCustomShapeGeometryItem::Clone( SfxItemPool * /*pPool*/ ) const
return new SdrCustomShapeGeometryItem( aPropSeq );
}
-sal_uInt16 SdrCustomShapeGeometryItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/ ) const
-{
- return 1;
-}
bool SdrCustomShapeGeometryItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
{
rVal <<= aPropSeq;
return true;
}
+
bool SdrCustomShapeGeometryItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
{
if ( ! ( rVal >>= aPropSeq ) )
diff --git a/svx/source/items/e3ditem.cxx b/svx/source/items/e3ditem.cxx
index 86f749c6eaab..1c83aa408f33 100644
--- a/svx/source/items/e3ditem.cxx
+++ b/svx/source/items/e3ditem.cxx
@@ -94,11 +94,6 @@ bool SvxB3DVectorItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
}
-sal_uInt16 SvxB3DVectorItem::GetVersion (sal_uInt16 nFileFormatVersion) const
-{
- return (nFileFormatVersion == SOFFICE_FILEFORMAT_31) ? USHRT_MAX : 0;
-}
-
void SvxB3DVectorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SvxB3DVectorItem"));
diff --git a/svx/source/items/legacyitem.cxx b/svx/source/items/legacyitem.cxx
new file mode 100755
index 000000000000..005f97d2d95b
--- /dev/null
+++ b/svx/source/items/legacyitem.cxx
@@ -0,0 +1,105 @@
+/* -*- 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 .
+ */
+
+#include <svx/legacyitem.hxx>
+#include <tools/stream.hxx>
+#include <svx/algitem.hxx>
+#include <svx/rotmodit.hxx>
+
+namespace legacy
+{
+ namespace SvxOrientation
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxOrientationItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_uInt16 nVal(0);
+ rStrm.ReadUInt16( nVal );
+ rItem.SetValue(static_cast<::SvxCellOrientation>(nVal));
+ }
+
+ SvStream& Store(const SvxOrientationItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteUInt16( static_cast<sal_uInt16>(rItem.GetValue()) );
+ return rStrm;
+ }
+ }
+
+ namespace SvxMargin
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxMarginItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_Int16 nLeft(0);
+ sal_Int16 nTop(0);
+ sal_Int16 nRight(0);
+ sal_Int16 nBottom(0);
+
+ rStrm.ReadInt16( nLeft );
+ rStrm.ReadInt16( nTop );
+ rStrm.ReadInt16( nRight );
+ rStrm.ReadInt16( nBottom );
+
+ rItem.SetLeftMargin(nLeft);
+ rItem.SetTopMargin(nTop);
+ rItem.SetRightMargin(nRight);
+ rItem.SetBottomMargin(nBottom);
+ }
+
+ SvStream& Store(const SvxMarginItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteInt16( rItem.GetLeftMargin() );
+ rStrm.WriteInt16( rItem.GetTopMargin() );
+ rStrm.WriteInt16( rItem.GetRightMargin() );
+ rStrm.WriteInt16( rItem.GetBottomMargin() );
+ return rStrm;
+ }
+ }
+
+ namespace SvxRotateMode
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxRotateModeItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_uInt16 nVal(0);
+ rStrm.ReadUInt16( nVal );
+ rItem.SetValue(static_cast<::SvxRotateMode>(nVal));
+ }
+
+ SvStream& Store(const SvxRotateModeItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteUInt16( static_cast<sal_uInt16>(rItem.GetValue()) );
+ return rStrm;
+ }
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/items/rotmodit.cxx b/svx/source/items/rotmodit.cxx
index bf147b2aa2d6..274a01d46160 100644
--- a/svx/source/items/rotmodit.cxx
+++ b/svx/source/items/rotmodit.cxx
@@ -56,13 +56,6 @@ SvxRotateModeItem::~SvxRotateModeItem()
{
}
-SfxPoolItem* SvxRotateModeItem::Create( SvStream& rStream, sal_uInt16 ) const
-{
- sal_uInt16 nVal;
- rStream.ReadUInt16( nVal );
- return new SvxRotateModeItem( static_cast<SvxRotateMode>(nVal),Which() );
-}
-
bool SvxRotateModeItem::GetPresentation(
SfxItemPresentation ePres,
MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
@@ -96,11 +89,6 @@ SfxPoolItem* SvxRotateModeItem::Clone( SfxItemPool* ) const
return new SvxRotateModeItem( *this );
}
-sal_uInt16 SvxRotateModeItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
-{
- return 0;
-}
-
bool SvxRotateModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
{
sal_Int32 nUno = table::CellVertJustify2::STANDARD;
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index c99b7e2ce467..5223c72e6889 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -1335,10 +1335,7 @@ SfxPoolItem* SdrTextFixedCellHeightItem::Clone( SfxItemPool * /*pPool*/) const
{
return new SdrTextFixedCellHeightItem( GetValue() );
}
-sal_uInt16 SdrTextFixedCellHeightItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
-{
- return 1;
-}
+
bool SdrTextFixedCellHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
bool bValue = GetValue();
@@ -1938,11 +1935,6 @@ SfxPoolItem* SdrGrafCropItem::Clone( SfxItemPool* /*pPool*/) const
return new SdrGrafCropItem( *this );
}
-sal_uInt16 SdrGrafCropItem::GetVersion( sal_uInt16 /*nFileVersion*/) const
-{
- // GRFCROP_VERSION_MOVETOSVX is 1
- return GRFCROP_VERSION_MOVETOSVX;
-}
SdrTextAniStartInsideItem::~SdrTextAniStartInsideItem()
{
}
diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx
index 7f8738d0f6ba..d465036d1edf 100644
--- a/svx/source/unodraw/unobrushitemhelper.cxx
+++ b/svx/source/unodraw/unobrushitemhelper.cxx
@@ -172,7 +172,7 @@ static sal_uInt16 getTransparenceForSvxBrushItem(const SfxItemSet& rSourceSet, b
return nFillTransparence;
}
-static SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, bool bSearchInParents, sal_uInt16 nBackgroundID)
+static std::shared_ptr<SvxBrushItem> getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, bool bSearchInParents, sal_uInt16 nBackgroundID)
{
Color aFillColor(rSourceSet.Get(XATTR_FILLCOLOR, bSearchInParents).GetColorValue());
@@ -189,10 +189,10 @@ static SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, bool b
aFillColor.SetTransparency(aTargetTrans);
}
- return SvxBrushItem(aFillColor, nBackgroundID);
+ return std::shared_ptr<SvxBrushItem>(new SvxBrushItem(aFillColor, nBackgroundID));
}
-SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack)
+std::shared_ptr<SvxBrushItem> getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack)
{
const XFillStyleItem* pXFillStyleItem(rSourceSet.GetItem<XFillStyleItem>(XATTR_FILLSTYLE, bSearchInParents));
@@ -207,10 +207,10 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
aFillColor.SetTransparency(0xff);
- return SvxBrushItem(aFillColor, nBackgroundID);
+ return std::shared_ptr<SvxBrushItem>(new SvxBrushItem(aFillColor, nBackgroundID));
}
- SvxBrushItem aRetval(nBackgroundID);
+ std::shared_ptr<SvxBrushItem> aRetval(new SvxBrushItem(nBackgroundID));
switch(pXFillStyleItem->GetValue())
{
@@ -249,7 +249,7 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
aMixedColor.SetTransparency(aTargetTrans);
}
- aRetval = SvxBrushItem(aMixedColor, nBackgroundID);
+ aRetval = std::shared_ptr<SvxBrushItem>(new SvxBrushItem(aMixedColor, nBackgroundID));
break;
}
case drawing::FillStyle_HATCH:
@@ -281,7 +281,7 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
const sal_uInt8 aTargetTrans(std::min(sal_uInt8(0xfe), static_cast< sal_uInt8 >((nFillTransparence * 254) / 100)));
aHatchColor.SetTransparency(aTargetTrans);
- aRetval = SvxBrushItem(aHatchColor, nBackgroundID);
+ aRetval = std::shared_ptr<SvxBrushItem>(new SvxBrushItem(aHatchColor, nBackgroundID));
}
break;
@@ -324,7 +324,7 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
}
// create with given graphic and position
- aRetval = SvxBrushItem(aGraphic, aSvxGraphicPosition, nBackgroundID);
+ aRetval = std::shared_ptr<SvxBrushItem>(new SvxBrushItem(aGraphic, aSvxGraphicPosition, nBackgroundID));
// get evtl. mixed transparence
const sal_uInt16 nFillTransparence(getTransparenceForSvxBrushItem(rSourceSet, bSearchInParents));
@@ -332,7 +332,7 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
if(0 != nFillTransparence)
{
// #i125189# nFillTransparence is in range [0..100] and needs to be in [0..100] signed
- aRetval.setGraphicTransparency(static_cast< sal_Int8 >(nFillTransparence));
+ aRetval->setGraphicTransparency(static_cast< sal_Int8 >(nFillTransparence));
}
break;
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 0830a9055f11..db10ce427596 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -1870,11 +1870,6 @@ SfxPoolItem* XSecondaryFillColorItem::Clone(SfxItemPool* /*pPool*/) const
return new XSecondaryFillColorItem(*this);
}
-sal_uInt16 XSecondaryFillColorItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/ ) const
-{
- return 2;
-}
-
bool XSecondaryFillColorItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -1982,14 +1977,6 @@ const XGradient& XFillGradientItem::GetGradientValue() const // GetValue -> GetG
return aGradient;
}
-sal_uInt16 XFillGradientItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
-{
- // !!! this version number also represents the version number of superclasses
- // !!! (e.g. XFillFloatTransparenceItem); if you make any changes here,
- // !!! the superclass is also affected
- return 1;
-}
-
bool XFillGradientItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -2283,13 +2270,6 @@ SfxPoolItem* XFillFloatTransparenceItem::Clone( SfxItemPool* /*pPool*/) const
return new XFillFloatTransparenceItem( *this );
}
-sal_uInt16 XFillFloatTransparenceItem::GetVersion( sal_uInt16 nFileFormatVersion ) const
-{
- // !!! if version number of this object must be increased, please !!!
- // !!! increase version number of base class XFillGradientItem !!!
- return XFillGradientItem::GetVersion( nFileFormatVersion );
-}
-
bool XFillFloatTransparenceItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
{
return XFillGradientItem::QueryValue( rVal, nMemberId );
diff --git a/svx/source/xoutdev/xattr2.cxx b/svx/source/xoutdev/xattr2.cxx
index 54fad1415071..2469c66981b7 100644
--- a/svx/source/xoutdev/xattr2.cxx
+++ b/svx/source/xoutdev/xattr2.cxx
@@ -78,11 +78,6 @@ XLineJointItem::XLineJointItem( css::drawing::LineJoint eLineJoint ) :
{
}
-sal_uInt16 XLineJointItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
-{
- return 1;
-}
-
SfxPoolItem* XLineJointItem::Clone(SfxItemPool* /*pPool*/) const
{
return new XLineJointItem( *this );
@@ -240,11 +235,6 @@ XLineCapItem::XLineCapItem(css::drawing::LineCap eLineCap)
{
}
-sal_uInt16 XLineCapItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
-{
- return 1;
-}
-
SfxPoolItem* XLineCapItem::Clone(SfxItemPool* /*pPool*/) const
{
return new XLineCapItem( *this );
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index 9a2d47d631ff..a7b204217638 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -167,11 +167,6 @@ bool XFillBitmapItem::isPattern() const
return vcl::bitmap::isHistorical8x8(GetGraphicObject().GetGraphic().GetBitmapEx(), aBack, aFront);
}
-sal_uInt16 XFillBitmapItem::GetVersion(sal_uInt16 /*nFileFormatVersion*/) const
-{
- return 2;
-}
-
bool XFillBitmapItem::GetPresentation(
SfxItemPresentation /*ePres*/,
MapUnit /*eCoreUnit*/,