[Libreoffice-commits] core.git: chart2/source cui/source dbaccess/source editeng/Library_editeng.mk editeng/source include/editeng include/sfx2 include/svl include/svx sc/inc sc/qa sc/source sd/qa sd/source sfx2/source solenv/clang-format svl/Library_svl.mk svl/source svx/Library_svx.mk svx/source sw/CppunitTest_sw_uiwriter.mk sw/inc sw/Library_sw.mk sw/qa sw/source
Armin Le Grand (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 25 18:00:18 UTC 2019
chart2/source/view/main/ChartItemPool.cxx | 4
cui/source/dialogs/hldocntp.cxx | 4
cui/source/inc/tabstpge.hxx | 2
cui/source/tabpages/backgrnd.cxx | 83 -
cui/source/tabpages/grfpage.cxx | 19
cui/source/tabpages/tabstpge.cxx | 91 -
dbaccess/source/ui/dlg/dbadmin.cxx | 2
dbaccess/source/ui/dlg/generalpage.cxx | 2
editeng/Library_editeng.mk | 1
editeng/source/editeng/editdoc.cxx | 32
editeng/source/editeng/impedit.hxx | 2
editeng/source/editeng/impedit4.cxx | 2
editeng/source/items/bulitem.cxx | 9
editeng/source/items/frmitems.cxx | 505 ----------
editeng/source/items/justifyitem.cxx | 17
editeng/source/items/legacyitem.cxx | 807 ++++++++++++++++
editeng/source/items/numitem.cxx | 12
editeng/source/items/paraitem.cxx | 92 -
editeng/source/items/textitem.cxx | 312 ------
editeng/source/items/writingmodeitem.cxx | 5
editeng/source/items/xmlcnitm.cxx | 6
editeng/source/rtf/rtfitem.cxx | 91 +
include/editeng/adjustitem.hxx | 22
include/editeng/boxitem.hxx | 5
include/editeng/brushitem.hxx | 9
include/editeng/bulletitem.hxx | 1
include/editeng/charreliefitem.hxx | 1
include/editeng/charrotateitem.hxx | 2
include/editeng/charscaleitem.hxx | 1
include/editeng/colritem.hxx | 10
include/editeng/contouritem.hxx | 9
include/editeng/crossedoutitem.hxx | 7
include/editeng/emphasismarkitem.hxx | 1
include/editeng/fhgtitem.hxx | 18
include/editeng/fontitem.hxx | 5
include/editeng/forbiddenruleitem.hxx | 1
include/editeng/formatbreakitem.hxx | 11
include/editeng/frmdiritem.hxx | 9
include/editeng/hngpnctitem.hxx | 1
include/editeng/justifyitem.hxx | 12
include/editeng/keepitem.hxx | 9
include/editeng/langitem.hxx | 5
include/editeng/legacyitem.hxx | 192 +++
include/editeng/lineitem.hxx | 3
include/editeng/lrspitem.hxx | 17
include/editeng/numitem.hxx | 1
include/editeng/opaqitem.hxx | 9
include/editeng/paravertalignitem.hxx | 1
include/editeng/pgrditem.hxx | 1
include/editeng/postitem.hxx | 8
include/editeng/protitem.hxx | 10
include/editeng/scriptspaceitem.hxx | 1
include/editeng/scripttypeitem.hxx | 1
include/editeng/shaditem.hxx | 13
include/editeng/shdditem.hxx | 6
include/editeng/sizeitem.hxx | 9
include/editeng/tstpitem.hxx | 2
include/editeng/twolinesitem.hxx | 2
include/editeng/udlnitem.hxx | 12
include/editeng/ulspitem.hxx | 13
include/editeng/wghtitem.hxx | 8
include/editeng/writingmodeitem.hxx | 1
include/editeng/xmlcnitm.hxx | 2
include/sfx2/evntconf.hxx | 1
include/sfx2/tabdlg.hxx | 1
include/svl/aeitem.hxx | 6
include/svl/cintitem.hxx | 22
include/svl/eitem.hxx | 19
include/svl/flagitem.hxx | 2
include/svl/int64item.hxx | 5
include/svl/intitem.hxx | 26
include/svl/lckbitem.hxx | 3
include/svl/legacyitem.hxx | 52 +
include/svl/macitem.hxx | 1
include/svl/poolitem.hxx | 4
include/svl/ptitem.hxx | 2
include/svl/rectitem.hxx | 2
include/svl/rngitem.hxx | 2
include/svl/slstitm.hxx | 3
include/svl/stritem.hxx | 6
include/svl/visitem.hxx | 6
include/svx/algitem.hxx | 21
include/svx/autoformathelper.hxx | 218 ++++
include/svx/chrtitem.hxx | 5
include/svx/e3ditem.hxx | 2
include/svx/hlnkitem.hxx | 2
include/svx/legacyitem.hxx | 60 +
include/svx/rotmodit.hxx | 2
include/svx/sdasitm.hxx | 1
include/svx/sdgcpitm.hxx | 1
include/svx/sdtacitm.hxx | 4
include/svx/sdtfchim.hxx | 1
include/svx/svx3ditems.hxx | 6
include/svx/unobrushitemhelper.hxx | 2
include/svx/xbtmpit.hxx | 1
include/svx/xflftrit.hxx | 1
include/svx/xflgrit.hxx | 1
include/svx/xlinjoit.hxx | 1
include/svx/xlncapit.hxx | 1
include/svx/xsflclit.hxx | 3
sc/inc/attrib.hxx | 1
sc/inc/autoform.hxx | 141 --
sc/qa/unit/subsequent_filters-test.cxx | 2
sc/source/core/data/attrib.cxx | 5
sc/source/core/data/patattr.cxx | 55 -
sc/source/core/tool/autoform.cxx | 343 +-----
sc/source/ui/docshell/docsh4.cxx | 4
sc/source/ui/drawfunc/drtxtob.cxx | 15
sc/source/ui/inc/viewfunc.hxx | 5
sc/source/ui/view/cellsh.cxx | 2
sc/source/ui/view/editsh.cxx | 17
sc/source/ui/view/formatsh.cxx | 92 -
sc/source/ui/view/output2.cxx | 12
sc/source/ui/view/tabvwsha.cxx | 29
sc/source/ui/view/viewfun2.cxx | 2
sc/source/ui/view/viewfun4.cxx | 2
sc/source/ui/view/viewfunc.cxx | 20
sd/qa/unit/import-tests.cxx | 2
sd/source/ui/table/TableDesignPane.cxx | 10
sfx2/source/appl/appserv.cxx | 8
sfx2/source/appl/linkmgr2.cxx | 2
sfx2/source/config/evntconf.cxx | 6
sfx2/source/dialog/tabdlg.cxx | 6
solenv/clang-format/blacklist | 10
svl/Library_svl.mk | 1
svl/source/items/aeitem.cxx | 11
svl/source/items/cenumitm.cxx | 13
svl/source/items/cintitem.cxx | 77 -
svl/source/items/flagitem.cxx | 14
svl/source/items/int64item.cxx | 16
svl/source/items/intitem.cxx | 29
svl/source/items/lckbitem.cxx | 47
svl/source/items/legacyitem.cxx | 69 +
svl/source/items/macitem.cxx | 7
svl/source/items/poolitem.cxx | 463 ++++++++-
svl/source/items/ptitem.cxx | 15
svl/source/items/rectitem.cxx | 15
svl/source/items/rngitem.cxx | 17
svl/source/items/slstitm.cxx | 42
svl/source/items/stritem.cxx | 21
svl/source/items/visitem.cxx | 21
svx/Library_svx.mk | 2
svx/source/dialog/svxruler.cxx | 31
svx/source/engine3d/svx3ditems.cxx | 30
svx/source/items/algitem.cxx | 32
svx/source/items/autoformathelper.cxx | 380 +++++++
svx/source/items/chrtitem.cxx | 22
svx/source/items/customshapeitem.cxx | 5
svx/source/items/e3ditem.cxx | 5
svx/source/items/legacyitem.cxx | 105 ++
svx/source/items/rotmodit.cxx | 12
svx/source/svdraw/svdattr.cxx | 10
svx/source/unodraw/unobrushitemhelper.cxx | 18
svx/source/xoutdev/xattr.cxx | 20
svx/source/xoutdev/xattr2.cxx | 10
svx/source/xoutdev/xattrbmp.cxx | 5
sw/CppunitTest_sw_uiwriter.mk | 1
sw/Library_sw.mk | 1
sw/inc/doc.hxx | 4
sw/inc/fesh.hxx | 8
sw/inc/fmtornt.hxx | 21
sw/inc/format.hxx | 4
sw/inc/legacyitem.hxx | 44
sw/inc/ndtxt.hxx | 2
sw/inc/paratr.hxx | 2
sw/inc/tblafmt.hxx | 132 --
sw/qa/core/filters-test.cxx | 2
sw/qa/core/uwriter.cxx | 78 -
sw/source/core/attr/format.cxx | 17
sw/source/core/doc/DocumentContentOperationsManager.cxx | 31
sw/source/core/doc/DocumentStylePoolManager.cxx | 37
sw/source/core/doc/doclay.cxx | 14
sw/source/core/doc/tblafmt.cxx | 478 ++-------
sw/source/core/doc/tblrwcl.cxx | 35
sw/source/core/docnode/ndtbl1.cxx | 48
sw/source/core/frmedt/fefly1.cxx | 12
sw/source/core/frmedt/fetab.cxx | 18
sw/source/core/inc/frmtool.hxx | 2
sw/source/core/layout/atrfrm.cxx | 58 -
sw/source/core/layout/flylay.cxx | 4
sw/source/core/layout/frmtool.cxx | 12
sw/source/core/layout/legacyitem.cxx | 82 +
sw/source/core/layout/pagedesc.cxx | 2
sw/source/core/layout/paintfrm.cxx | 7
sw/source/core/layout/tabfrm.cxx | 4
sw/source/core/layout/wsfrm.cxx | 12
sw/source/core/text/porfld.cxx | 2
sw/source/core/txtnode/ndtxt.cxx | 5
sw/source/core/unocore/unoframe.cxx | 26
sw/source/core/unocore/unoparagraph.cxx | 4
sw/source/core/unocore/unostyle.cxx | 44
sw/source/core/unocore/unotbl.cxx | 42
sw/source/filter/basflt/fltini.cxx | 18
sw/source/filter/html/css1atr.cxx | 10
sw/source/filter/html/htmlcss1.cxx | 22
sw/source/filter/html/htmlflywriter.cxx | 9
sw/source/filter/html/htmlgrin.cxx | 22
sw/source/filter/html/htmltabw.cxx | 12
sw/source/filter/html/svxcss1.cxx | 20
sw/source/filter/html/swcss1.hxx | 2
sw/source/filter/html/swhtml.cxx | 12
sw/source/filter/html/wrthtml.cxx | 5
sw/source/filter/writer/wrt_fn.cxx | 4
sw/source/filter/ww8/docxexport.cxx | 4
sw/source/filter/ww8/rtfexport.cxx | 2
sw/source/filter/ww8/wrtw8esh.cxx | 24
sw/source/filter/ww8/wrtw8nds.cxx | 9
sw/source/filter/ww8/wrtww8.cxx | 8
sw/source/filter/ww8/wrtww8.hxx | 4
sw/source/filter/ww8/ww8atr.cxx | 6
sw/source/filter/ww8/ww8par.cxx | 20
sw/source/filter/ww8/ww8par.hxx | 4
sw/source/filter/ww8/ww8par3.cxx | 13
sw/source/filter/ww8/ww8par6.cxx | 49
sw/source/ui/dialog/uiregionsw.cxx | 48
sw/source/ui/frmdlg/wrap.cxx | 13
sw/source/uibase/app/apphdl.cxx | 2
sw/source/uibase/app/docsh2.cxx | 4
sw/source/uibase/docvw/romenu.cxx | 20
sw/source/uibase/docvw/romenu.hxx | 2
sw/source/uibase/shells/annotsh.cxx | 17
sw/source/uibase/shells/basesh.cxx | 30
sw/source/uibase/shells/drwtxtsh.cxx | 12
sw/source/uibase/shells/frmsh.cxx | 110 +-
sw/source/uibase/shells/tabsh.cxx | 86 -
sw/source/uibase/shells/textsh.cxx | 54 -
sw/source/uibase/uiview/formatclipboard.cxx | 30
sw/source/uibase/uiview/viewtab.cxx | 25
sw/source/uibase/utlui/navipi.cxx | 2
sw/source/uibase/utlui/uitool.cxx | 48
230 files changed, 3745 insertions(+), 3735 deletions(-)
New commits:
commit 1e2682235cded9a7cd90e55f0bfc60a1285e9a46
Author: Armin Le Grand <Armin.Le.Grand at me.com>
AuthorDate: Thu Apr 18 19:25:06 2019 +0200
Commit: Armin Le Grand <Armin.Le.Grand at me.com>
CommitDate: Thu Apr 25 19:59:04 2019 +0200
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 at me.com>
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 894955bc10dd..d0a7b5ce87d7 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -157,8 +157,8 @@ ChartItemPool::ChartItemPool():
rPoolDefaults[SCHATTR_REGRESSION_SET_INTERCEPT - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SET_INTERCEPT, false);
rPoolDefaults[SCHATTR_REGRESSION_INTERCEPT_VALUE - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_REGRESSION_INTERCEPT_VALUE);
rPoolDefaults[SCHATTR_REGRESSION_CURVE_NAME - SCHATTR_START] = new SfxStringItem(SCHATTR_REGRESSION_CURVE_NAME, OUString());
- rPoolDefaults[SCHATTR_REGRESSION_XNAME - SCHATTR_START] = new SfxStringItem(SCHATTR_REGRESSION_XNAME, OUString("x"));
- rPoolDefaults[SCHATTR_REGRESSION_YNAME - SCHATTR_START] = new SfxStringItem(SCHATTR_REGRESSION_YNAME, OUString("f(x)"));
+ rPoolDefaults[SCHATTR_REGRESSION_XNAME - SCHATTR_START] = new SfxStringItem(SCHATTR_REGRESSION_XNAME, "x");
+ rPoolDefaults[SCHATTR_REGRESSION_YNAME - SCHATTR_START] = new SfxStringItem(SCHATTR_REGRESSION_YNAME, "f(x)");
/**************************************************************************
* ItemInfos
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 063b7ede1b8a..20f67d2e570d 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -309,8 +309,8 @@ IMPL_STATIC_LINK(SvxHyperlinkNewDocTp, DispatchDocument, void*, p, void)
// create items
SfxStringItem aName( SID_FILE_NAME, xExecuteInfo->aStrDocName );
- SfxStringItem aReferer( SID_REFERER, OUString("private:user") );
- SfxStringItem aFrame( SID_TARGETNAME, OUString("_blank") );
+ SfxStringItem aReferer( SID_REFERER, "private:user" );
+ SfxStringItem aFrame( SID_TARGETNAME, "_blank");
OUString aStrFlags('S');
if (xExecuteInfo->bRbtEditLater)
diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx
index 3288e0536ffb..949877077bd2 100644
--- a/cui/source/inc/tabstpge.hxx
+++ b/cui/source/inc/tabstpge.hxx
@@ -82,7 +82,7 @@ private:
// local variables, internal functions
SvxTabStop aCurrentTab;
- SvxTabStopItem aNewTabs;
+ std::unique_ptr<SvxTabStopItem> aNewTabs;
long nDefDist;
TabWin_Impl m_aLeftWin;
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index dc15fb3a0cf6..bcfa66d42132 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -396,12 +396,14 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
if (USHRT_MAX == nDestValue && m_xTblLBox->get_visible())
nDestValue = 0;
sal_uInt16 nWhich = GetWhich(nSlot);
- SvxBrushItem aBgdAttr(nWhich);
+ std::shared_ptr<SvxBrushItem> aBgdAttr(std::make_shared<SvxBrushItem>(nWhich));
if (rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT)
{
if (!bCharBackColor)
- aBgdAttr = static_cast<const SvxBrushItem&>(rSet->Get(nWhich));
+ {
+ aBgdAttr.reset(static_cast<SvxBrushItem*>(rSet->Get(nWhich).Clone()));
+ }
else
{
// EE_CHAR_BKGCOLOR is SvxBackgroundColorItem, but char background tabpage
@@ -409,7 +411,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
// extract Color out of SvxBackColorItem
Color aBackColor = static_cast<const SvxBackgroundColorItem&>(rSet->Get(nWhich)).GetValue();
// make new SvxBrushItem with this Color
- aBgdAttr = SvxBrushItem(aBackColor, SID_ATTR_BRUSH_CHAR);
+ aBgdAttr = std::make_shared<SvxBrushItem>(aBackColor, SID_ATTR_BRUSH_CHAR);
}
bBrushItemSet = true;
}
@@ -418,8 +420,8 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
if (bBrushItemSet)
{
- FillControls_Impl(aBgdAttr, aUserData);
- aBgdColor = aBgdAttr.GetColor();
+ FillControls_Impl(*aBgdAttr, aUserData);
+ aBgdColor = aBgdAttr->GetColor();
}
else
{
@@ -446,22 +448,19 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_BRUSH );
if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
{
- aBgdAttr = static_cast<const SvxBrushItem&>(rSet->Get(nWhich));
- m_pCellBrush.reset(new SvxBrushItem(aBgdAttr));
+ m_pCellBrush.reset(static_cast<SvxBrushItem*>(rSet->Get(nWhich).Clone()));
}
m_nCellWhich = nWhich;
if ( rSet->GetItemState( SID_ATTR_BRUSH_ROW, false ) >= SfxItemState::DEFAULT )
{
- aBgdAttr = static_cast<const SvxBrushItem&>(rSet->Get(SID_ATTR_BRUSH_ROW));
- m_pRowBrush.reset(new SvxBrushItem(aBgdAttr));
+ m_pRowBrush.reset(static_cast<SvxBrushItem*>(rSet->Get(SID_ATTR_BRUSH_ROW).Clone()));
}
m_nRowWhich = SID_ATTR_BRUSH_ROW;
if ( rSet->GetItemState( SID_ATTR_BRUSH_TABLE, false ) >= SfxItemState::DEFAULT )
{
- aBgdAttr = static_cast<const SvxBrushItem&>(rSet->Get(SID_ATTR_BRUSH_TABLE));
- m_pTableBrush.reset(new SvxBrushItem(aBgdAttr));
+ m_pTableBrush.reset(static_cast<SvxBrushItem*>(rSet->Get(SID_ATTR_BRUSH_TABLE).Clone()));
}
m_nTableWhich = SID_ATTR_BRUSH_TABLE;
@@ -473,8 +472,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_BRUSH_CHAR );
if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
{
- aBgdAttr = static_cast<const SvxBrushItem&>(rSet->Get(nWhich));
- pHighlighting.reset(new SvxBrushItem(aBgdAttr));
+ pHighlighting.reset(static_cast<SvxBrushItem*>(rSet->Get(nWhich).Clone()));
}
}
else if( bCharBackColor )
@@ -487,8 +485,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
// extract Color out of SvxBackColorItem
Color aBackColor = static_cast<const SvxBackgroundColorItem&>(rSet->Get(nWhich)).GetValue();
// make new SvxBrushItem with this Color
- aBgdAttr = SvxBrushItem(aBackColor, SID_ATTR_BRUSH_CHAR);
- pHighlighting.reset(new SvxBrushItem(aBgdAttr));
+ pHighlighting = std::make_unique<SvxBrushItem>(aBackColor, SID_ATTR_BRUSH_CHAR);
}
}
}
@@ -596,21 +593,23 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
if (bModifyBrush)
{
bModified = true;
+ std::unique_ptr<SvxBrushItem> aTmpBrush;
- SvxBrushItem aTmpBrush(nWhich);
if ( bIsLink )
{
- aTmpBrush = SvxBrushItem( aBgdGraphicPath,
+ aTmpBrush.reset(new SvxBrushItem( aBgdGraphicPath,
aBgdGraphicFilter,
eNewPos,
- nWhich );
+ nWhich ));
}
else
- aTmpBrush = SvxBrushItem( aBgdGraphic,
+ {
+ aTmpBrush.reset(new SvxBrushItem( aBgdGraphic,
eNewPos,
- nWhich );
+ nWhich ));
+ }
- rCoreSet->Put(aTmpBrush);
+ rCoreSet->Put(*aTmpBrush);
}
else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
rCoreSet->ClearItem( nWhich );
@@ -1133,20 +1132,20 @@ IMPL_LINK(SvxBackgroundTabPage, TblDestinationHdl_Impl, weld::ComboBox&, rBox, v
if( m_nActPos != nSelPos)
{
std::unique_ptr<SvxBrushItem> xItemHolder;
- SvxBrushItem* pActItem = nullptr;
+ std::unique_ptr<SvxBrushItem>* pActItem = nullptr;
sal_uInt16 nWhich = 0;
switch(m_nActPos)
{
case TBL_DEST_CELL:
- pActItem = m_pCellBrush.get();
+ pActItem = &m_pCellBrush;
nWhich = m_nCellWhich;
break;
case TBL_DEST_ROW:
- pActItem = m_pRowBrush.get();
+ pActItem = &m_pRowBrush;
nWhich = m_nRowWhich;
break;
case TBL_DEST_TBL:
- pActItem = m_pTableBrush.get();
+ pActItem = &m_pTableBrush;
nWhich = m_nTableWhich;
break;
default:
@@ -1157,11 +1156,11 @@ IMPL_LINK(SvxBackgroundTabPage, TblDestinationHdl_Impl, weld::ComboBox&, rBox, v
if(!pActItem)
{
xItemHolder.reset(new SvxBrushItem(nWhich));
- pActItem = xItemHolder.get();
+ pActItem = &xItemHolder;
}
if(drawing::FillStyle_SOLID == lcl_getFillStyle(*m_xLbSelect)) // brush selected
{
- *pActItem = SvxBrushItem( aBgdColor, nWhich );
+ *pActItem = std::make_unique<SvxBrushItem>(aBgdColor, nWhich);
}
else
{
@@ -1172,28 +1171,32 @@ IMPL_LINK(SvxBackgroundTabPage, TblDestinationHdl_Impl, weld::ComboBox&, rBox, v
bIsGraphicValid = LoadLinkedGraphic_Impl();
if ( bIsLink )
- *pActItem = SvxBrushItem( aBgdGraphicPath,
+ {
+ *pActItem = std::make_unique<SvxBrushItem>( aBgdGraphicPath,
aBgdGraphicFilter,
eNewPos,
- pActItem->Which() );
+ (*pActItem)->Which() );
+ }
else
- *pActItem = SvxBrushItem( aBgdGraphic,
+ {
+ *pActItem = std::make_unique<SvxBrushItem>( aBgdGraphic,
eNewPos,
- pActItem->Which() );
+ (*pActItem)->Which() );
+ }
}
switch(nSelPos)
{
case TBL_DEST_CELL:
- pActItem = m_pCellBrush.get();
+ pActItem = &m_pCellBrush;
m_xLbSelect->set_sensitive(true);
nWhich = m_nCellWhich;
break;
case TBL_DEST_ROW:
- pActItem = m_pRowBrush.get();
+ pActItem = &m_pRowBrush;
nWhich = m_nRowWhich;
break;
case TBL_DEST_TBL:
- pActItem = m_pTableBrush.get();
+ pActItem = &m_pTableBrush;
m_xLbSelect->set_sensitive(true);
nWhich = m_nTableWhich;
break;
@@ -1208,9 +1211,9 @@ IMPL_LINK(SvxBackgroundTabPage, TblDestinationHdl_Impl, weld::ComboBox&, rBox, v
if (!pActItem)
{
xItemHolder.reset(new SvxBrushItem(nWhich));
- pActItem = xItemHolder.get();
+ pActItem = &xItemHolder;
}
- FillControls_Impl(*pActItem, aUserData);
+ FillControls_Impl(**pActItem, aUserData);
}
}
@@ -1492,9 +1495,9 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
}
case drawing::FillStyle_BITMAP:
{
- SvxBrushItem aBrushItem( getSvxBrushItemFromSourceSet( maSet, nWhich ) );
- if ( GraphicType::NONE != aBrushItem.GetGraphicObject()->GetType() )
- rCoreSet->Put( aBrushItem );
+ std::shared_ptr<SvxBrushItem> aBrushItem( getSvxBrushItemFromSourceSet( maSet, nWhich ) );
+ if ( GraphicType::NONE != aBrushItem->GetGraphicObject()->GetType() )
+ rCoreSet->Put( *aBrushItem );
break;
}
default:
@@ -1597,7 +1600,7 @@ IMPL_LINK(SvxBkgTabPage, TblDestinationHdl_Impl, weld::ComboBox&, rBox, void)
// fill local item set with XATTR_FILL settings gathered from tab page
// and convert to SvxBrushItem and store in table destination slot Which
SvxAreaTabPage::FillItemSet(&maSet);
- maSet.Put(getSvxBrushItemFromSourceSet(maSet, maSet.GetPool()->GetWhich(lcl_GetTableDestSlot(m_nActPos))));
+ maSet.Put(*getSvxBrushItemFromSourceSet(maSet, maSet.GetPool()->GetWhich(lcl_GetTableDestSlot(m_nActPos))));
}
sal_Int32 nSelPos = rBox.get_active();
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 648c6c6c366e..b9e04205f6af 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -229,27 +229,30 @@ bool SvxGrfCropPage::FillItemSet(SfxItemSet *rSet)
sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_FRMSIZE );
FieldUnit eUnit = MapToFieldUnit( rSet->GetPool()->GetMetric( nW ));
- SvxSizeItem aSz( nW );
+ std::shared_ptr<SvxSizeItem> aSz(std::make_shared<SvxSizeItem>(nW));
// size could already have been set from another page
const SfxItemSet* pExSet = GetDialogExampleSet();
const SfxPoolItem* pItem = nullptr;
- if( pExSet && SfxItemState::SET ==
- pExSet->GetItemState( nW, false, &pItem ) )
- aSz = *static_cast<const SvxSizeItem*>(pItem);
+ if( pExSet && SfxItemState::SET ==pExSet->GetItemState( nW, false, &pItem ) )
+ {
+ aSz.reset(static_cast< SvxSizeItem*>(pItem->Clone()));
+ }
else
- aSz = static_cast<const SvxSizeItem&>(GetItemSet().Get( nW ));
+ {
+ aSz.reset(static_cast< SvxSizeItem*>(GetItemSet().Get(nW).Clone()));
+ }
- Size aTmpSz( aSz.GetSize() );
+ Size aTmpSz( aSz->GetSize() );
if( m_xWidthMF->get_value_changed_from_saved() )
aTmpSz.setWidth( lcl_GetValue( *m_xWidthMF, eUnit ) );
if( m_xHeightMF->get_value_changed_from_saved() )
aTmpSz.setHeight( lcl_GetValue( *m_xHeightMF, eUnit ) );
- aSz.SetSize( aTmpSz );
+ aSz->SetSize( aTmpSz );
m_xWidthMF->save_value();
m_xHeightMF->save_value();
- bModified |= nullptr != rSet->Put( aSz );
+ bModified |= nullptr != rSet->Put( *aSz );
if( bSetOrigSize )
{
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index e4e92fc1c90b..3ff07765f8af 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -64,7 +64,7 @@ void TabWin_Impl::Paint(vcl::RenderContext& rRenderContext, const ::tools::Recta
SvxTabulatorTabPage::SvxTabulatorTabPage(TabPageParent pParent, const SfxItemSet& rAttr)
: SfxTabPage(pParent, "cui/ui/paratabspage.ui", "ParagraphTabsPage", &rAttr)
, aCurrentTab(0)
- , aNewTabs(0, 0, SvxTabAdjust::Left, GetWhich(SID_ATTR_TABSTOP))
+ , aNewTabs(std::make_unique<SvxTabStopItem>(0, 0, SvxTabAdjust::Left, GetWhich(SID_ATTR_TABSTOP)))
, nDefDist(0)
, m_xTabSpin(m_xBuilder->weld_metric_spin_button("SP_TABPOS", FieldUnit::CM))
, m_xTabBox(m_xBuilder->weld_entry_tree_view("tabgrid", "ED_TABPOS", "LB_TABPOS"))
@@ -171,7 +171,7 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet)
GetDezCharHdl_Impl(*m_xDezChar);
GetFillCharHdl_Impl(*m_xFillChar);
- FillUpWithDefTabs_Impl(nDefDist, aNewTabs);
+ FillUpWithDefTabs_Impl(nDefDist, *aNewTabs);
SfxItemPool* pPool = rSet->GetPool();
MapUnit eUnit = pPool->GetMetric(GetWhich(SID_ATTR_TABSTOP));
const SfxPoolItem* pOld = GetOldItem(*rSet, SID_ATTR_TABSTOP);
@@ -188,28 +188,28 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet)
if (pLRSpace && static_cast<const SvxLRSpaceItem*>(pLRSpace)->GetTextFirstLineOfst() < 0)
{
SvxTabStop aNull(0, SvxTabAdjust::Default);
- aNewTabs.Insert(aNull);
+ aNewTabs->Insert(aNull);
}
- SvxTabStopItem aTmp(aNewTabs);
- aTmp.Remove(0, aTmp.Count());
+ std::unique_ptr<SvxTabStopItem> aTmp(static_cast<SvxTabStopItem*>(aNewTabs->Clone()));
+ aTmp->Remove(0, aTmp->Count());
- for (sal_uInt16 i = 0; i < aNewTabs.Count(); ++i)
+ for (sal_uInt16 i = 0; i < aNewTabs->Count(); ++i)
{
- SvxTabStop aTmpStop = aNewTabs[i];
+ SvxTabStop aTmpStop = (*aNewTabs)[i];
aTmpStop.GetTabPos() = LogicToLogic(aTmpStop.GetTabPos(), MapUnit::Map100thMM, eUnit);
- aTmp.Insert(aTmpStop);
+ aTmp->Insert(aTmpStop);
}
- if (!pOld || *static_cast<const SvxTabStopItem*>(pOld) != aTmp)
+ if (!pOld || *static_cast<const SvxTabStopItem*>(pOld) != *aTmp)
{
- rSet->Put(aTmp);
+ rSet->Put(*aTmp);
bModified = true;
}
}
- else if (!pOld || *static_cast<const SvxTabStopItem*>(pOld) != aNewTabs)
+ else if (!pOld || *static_cast<const SvxTabStopItem*>(pOld) != *aNewTabs)
{
- rSet->Put(aNewTabs);
+ rSet->Put(*aNewTabs);
bModified = true;
}
@@ -233,21 +233,25 @@ void SvxTabulatorTabPage::Reset(const SfxItemSet* rSet)
{
if (MapUnit::Map100thMM != eUnit)
{
- SvxTabStopItem aTmp(*static_cast<const SvxTabStopItem*>(pItem));
- aNewTabs.Remove(0, aNewTabs.Count());
+ std::unique_ptr<SvxTabStopItem> aTmp(static_cast<SvxTabStopItem*>(pItem->Clone()));
+ aNewTabs->Remove(0, aNewTabs->Count());
- for (sal_uInt16 i = 0; i < aTmp.Count(); ++i)
+ for (sal_uInt16 i = 0; i < aTmp->Count(); ++i)
{
- SvxTabStop aTmpStop = aTmp[i];
+ SvxTabStop aTmpStop = (*aTmp)[i];
aTmpStop.GetTabPos() = LogicToLogic(aTmpStop.GetTabPos(), eUnit, MapUnit::Map100thMM);
- aNewTabs.Insert(aTmpStop);
+ aNewTabs->Insert(aTmpStop);
}
}
else
- aNewTabs = *static_cast<const SvxTabStopItem*>(pItem);
+ {
+ aNewTabs.reset(static_cast<SvxTabStopItem*>(pItem->Clone()));
+ }
}
else
- aNewTabs.Remove(0, aNewTabs.Count());
+ {
+ aNewTabs->Remove(0, aNewTabs->Count());
+ }
// Default tab distance
nDefDist = SVX_TAB_DEFDIST;
@@ -330,20 +334,21 @@ void SvxTabulatorTabPage::InitTabPos_Impl( sal_uInt16 nTabPos )
}
// Correct current TabPos and default tabs
- for ( sal_uInt16 i = 0; i < aNewTabs.Count(); i++ )
+ for ( sal_uInt16 i = 0; i < aNewTabs->Count(); i++ )
{
- if ( aNewTabs[i].GetAdjustment() != SvxTabAdjust::Default )
+ if ( (*aNewTabs)[i].GetAdjustment() != SvxTabAdjust::Default )
{
- m_xTabSpin->set_value(m_xTabSpin->normalize(
- aNewTabs[i].GetTabPos() + nOffset ), eDefUnit);
+ m_xTabSpin->set_value(m_xTabSpin->normalize((*aNewTabs)[i].GetTabPos() + nOffset ), eDefUnit);
m_xTabBox->append_text(m_xTabSpin->get_text());
}
else
- aNewTabs.Remove( i-- );
+ {
+ aNewTabs->Remove( i-- );
+ }
}
// Select current tabulator
- const sal_uInt16 nSize = aNewTabs.Count();
+ const sal_uInt16 nSize = aNewTabs->Count();
if ( nTabPos >= nSize )
nTabPos = 0;
@@ -355,7 +360,7 @@ void SvxTabulatorTabPage::InitTabPos_Impl( sal_uInt16 nTabPos )
if (m_xTabBox->get_count() > 0)
{
m_xTabBox->set_active(nTabPos);
- aCurrentTab = aNewTabs[nTabPos];
+ aCurrentTab = (*aNewTabs)[nTabPos];
SetFillAndTabType_Impl();
m_xNewBtn->set_sensitive(false);
@@ -449,7 +454,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(const weld::Button* pBtn)
sal_Int32 i;
for( i = 0; i < nSize; i++ )
{
- if ( nReal < aNewTabs[i].GetTabPos() )
+ if ( nReal < (*aNewTabs)[i].GetTabPos() )
break;
}
@@ -468,7 +473,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(const weld::Button* pBtn)
eAdj = SvxTabAdjust::Decimal;
aCurrentTab.GetAdjustment() = eAdj;
- aNewTabs.Insert( aCurrentTab );
+ aNewTabs->Insert( aCurrentTab );
m_xNewBtn->set_sensitive(false);
m_xDelBtn->set_sensitive(true);
@@ -497,17 +502,17 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, DelHdl_Impl, weld::Button&, void)
// Delete Tab
m_xTabBox->remove(nPos);
- aNewTabs.Remove( nPos );
+ aNewTabs->Remove( nPos );
// Reset aCurrentTab
- const sal_uInt16 nSize = aNewTabs.Count();
+ const sal_uInt16 nSize = aNewTabs->Count();
if ( nSize > 0 )
{
// Correct Pos
nPos = ( ( nSize - 1 ) >= nPos) ? nPos : nPos - 1;
m_xTabBox->set_active(nPos);
- aCurrentTab = aNewTabs[nPos];
+ aCurrentTab = (*aNewTabs)[nPos];
}
// If no Tabs Enable Disable Controls
@@ -521,9 +526,9 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, DelHdl_Impl, weld::Button&, void)
IMPL_LINK_NOARG(SvxTabulatorTabPage, DelAllHdl_Impl, weld::Button&, void)
{
- if ( aNewTabs.Count() )
+ if ( aNewTabs->Count() )
{
- aNewTabs = SvxTabStopItem( 0 );
+ aNewTabs = std::make_unique<SvxTabStopItem>( 0 );
InitTabPos_Impl();
}
}
@@ -553,8 +558,8 @@ IMPL_LINK(SvxTabulatorTabPage, TabTypeCheckHdl_Impl, weld::Button&, rBox, void)
int nPos = FindCurrentTab();
if (nPos != -1)
{
- aNewTabs.Remove( nPos );
- aNewTabs.Insert( aCurrentTab );
+ aNewTabs->Remove( nPos );
+ aNewTabs->Insert( aCurrentTab );
}
}
@@ -579,8 +584,8 @@ IMPL_LINK(SvxTabulatorTabPage, FillTypeCheckHdl_Impl, weld::Button&, rBox, void)
int nPos = FindCurrentTab();
if (nPos != -1)
{
- aNewTabs.Remove( nPos );
- aNewTabs.Insert( aCurrentTab );
+ aNewTabs->Remove( nPos );
+ aNewTabs->Insert( aCurrentTab );
}
}
@@ -593,8 +598,8 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, GetFillCharHdl_Impl, weld::Widget&, void)
const int nPos = FindCurrentTab();
if (nPos != -1)
{
- aNewTabs.Remove( nPos );
- aNewTabs.Insert( aCurrentTab );
+ aNewTabs->Remove( nPos );
+ aNewTabs->Insert( aCurrentTab );
}
}
@@ -607,8 +612,8 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, GetDezCharHdl_Impl, weld::Widget&, void)
const int nPos = FindCurrentTab();
if (nPos != -1)
{
- aNewTabs.Remove( nPos );
- aNewTabs.Insert( aCurrentTab );
+ aNewTabs->Remove( nPos );
+ aNewTabs->Insert( aCurrentTab );
}
}
@@ -617,7 +622,7 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, SelectHdl_Impl, weld::TreeView&, void)
const int nPos = FindCurrentTab();
if (nPos != -1)
{
- aCurrentTab = aNewTabs[nPos];
+ aCurrentTab = (*aNewTabs)[nPos];
m_xNewBtn->set_sensitive(false);
SetFillAndTabType_Impl();
}
@@ -640,7 +645,7 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, ModifyHdl_Impl, weld::ComboBox&, void)
const int nPos = FindCurrentTab();
if (nPos != -1)
{
- aCurrentTab = aNewTabs[nPos];
+ aCurrentTab = (*aNewTabs)[nPos];
SetFillAndTabType_Impl();
m_xTabSpin->set_text(m_xTabBox->get_active_text());
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index bf6b8ec4a149..83b8bf1c2ce4 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -294,7 +294,7 @@ void ODbAdminDialog::createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, SfxItemP
*pCounter++ = new SfxStringItem(DSID_TEXTDELIMITER, OUString('"'));
*pCounter++ = new SfxStringItem(DSID_DECIMALDELIMITER, OUString('.'));
*pCounter++ = new SfxStringItem(DSID_THOUSANDSDELIMITER, OUString());
- *pCounter++ = new SfxStringItem(DSID_TEXTFILEEXTENSION, OUString("txt"));
+ *pCounter++ = new SfxStringItem(DSID_TEXTFILEEXTENSION, "txt");
*pCounter++ = new SfxBoolItem(DSID_TEXTFILEHEADER, true);
*pCounter++ = new SfxBoolItem(DSID_PARAMETERNAMESUBST, false);
*pCounter++ = new SfxInt32Item(DSID_CONN_PORTNUMBER, 8100);
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index f9328b841d29..829333294d05 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -617,7 +617,7 @@ namespace dbaui
if ( m_pRB_CreateDatabase->IsChecked() )
{
- _rCoreAttrs->Put( SfxStringItem( DSID_CONNECTURL, OUString( "sdbc:dbase:" ) ) );
+ _rCoreAttrs->Put( SfxStringItem( DSID_CONNECTURL, "sdbc:dbase:" ) );
bChangedSomething = true;
bCommitTypeSelection = false;
}
diff --git a/editeng/Library_editeng.mk b/editeng/Library_editeng.mk
index 87e23b8628da..9354071b3a70 100644
--- a/editeng/Library_editeng.mk
+++ b/editeng/Library_editeng.mk
@@ -77,6 +77,7 @@ $(eval $(call gb_Library_add_exception_objects,editeng,\
editeng/source/items/itemtype \
editeng/source/items/justifyitem \
editeng/source/items/numitem \
+ editeng/source/items/legacyitem \
editeng/source/items/optitems \
editeng/source/items/paperinf \
editeng/source/items/paraitem \
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 8c27e0dbf09a..ef5964c822f5 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -816,16 +816,16 @@ void ContentAttribsInfo::AppendCharAttrib(EditCharAttrib* pNew)
aPrevCharAttribs.push_back(std::unique_ptr<EditCharAttrib>(pNew));
}
-void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit )
+void ConvertItem( std::unique_ptr<SfxPoolItem>& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit )
{
DBG_ASSERT( eSourceUnit != eDestUnit, "ConvertItem - Why?!" );
- switch ( rPoolItem.Which() )
+ switch ( rPoolItem->Which() )
{
case EE_PARA_LRSPACE:
{
- assert(dynamic_cast<const SvxLRSpaceItem *>(&rPoolItem) != nullptr);
- SvxLRSpaceItem& rItem = static_cast<SvxLRSpaceItem&>(rPoolItem);
+ assert(dynamic_cast<const SvxLRSpaceItem *>(rPoolItem.get()) != nullptr);
+ SvxLRSpaceItem& rItem = static_cast<SvxLRSpaceItem&>(*rPoolItem);
rItem.SetTextFirstLineOfst( sal::static_int_cast< short >( OutputDevice::LogicToLogic( rItem.GetTextFirstLineOfst(), eSourceUnit, eDestUnit ) ) );
rItem.SetTextLeft( OutputDevice::LogicToLogic( rItem.GetTextLeft(), eSourceUnit, eDestUnit ) );
rItem.SetRight( OutputDevice::LogicToLogic( rItem.GetRight(), eSourceUnit, eDestUnit ) );
@@ -833,16 +833,16 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit
break;
case EE_PARA_ULSPACE:
{
- assert(dynamic_cast<const SvxULSpaceItem *>(&rPoolItem) != nullptr);
- SvxULSpaceItem& rItem = static_cast<SvxULSpaceItem&>(rPoolItem);
+ assert(dynamic_cast<const SvxULSpaceItem *>(rPoolItem.get()) != nullptr);
+ SvxULSpaceItem& rItem = static_cast<SvxULSpaceItem&>(*rPoolItem);
rItem.SetUpper( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetUpper(), eSourceUnit, eDestUnit ) ) );
rItem.SetLower( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLower(), eSourceUnit, eDestUnit ) ) );
}
break;
case EE_PARA_SBL:
{
- assert(dynamic_cast<const SvxLineSpacingItem *>(&rPoolItem) != nullptr);
- SvxLineSpacingItem& rItem = static_cast<SvxLineSpacingItem&>(rPoolItem);
+ assert(dynamic_cast<const SvxLineSpacingItem *>(rPoolItem.get()) != nullptr);
+ SvxLineSpacingItem& rItem = static_cast<SvxLineSpacingItem&>(*rPoolItem);
// SetLineHeight changes also eLineSpace!
if ( rItem.GetLineSpaceRule() == SvxLineSpaceRule::Min )
rItem.SetLineHeight( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLineHeight(), eSourceUnit, eDestUnit ) ) );
@@ -850,24 +850,24 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit
break;
case EE_PARA_TABS:
{
- assert(dynamic_cast<const SvxTabStopItem *>(&rPoolItem) != nullptr);
- SvxTabStopItem& rItem = static_cast<SvxTabStopItem&>(rPoolItem);
- SvxTabStopItem aNewItem( EE_PARA_TABS );
+ assert(dynamic_cast<const SvxTabStopItem *>(rPoolItem.get()) != nullptr);
+ SvxTabStopItem& rItem = static_cast<SvxTabStopItem&>(*rPoolItem);
+ SvxTabStopItem* pNewItem(new SvxTabStopItem(EE_PARA_TABS));
for ( sal_uInt16 i = 0; i < rItem.Count(); i++ )
{
const SvxTabStop& rTab = rItem[i];
SvxTabStop aNewStop( OutputDevice::LogicToLogic( rTab.GetTabPos(), eSourceUnit, eDestUnit ), rTab.GetAdjustment(), rTab.GetDecimal(), rTab.GetFill() );
- aNewItem.Insert( aNewStop );
+ pNewItem->Insert( aNewStop );
}
- rItem = aNewItem;
+ rPoolItem.reset(pNewItem);
}
break;
case EE_CHAR_FONTHEIGHT:
case EE_CHAR_FONTHEIGHT_CJK:
case EE_CHAR_FONTHEIGHT_CTL:
{
- assert(dynamic_cast<const SvxFontHeightItem *>(&rPoolItem) != nullptr);
- SvxFontHeightItem& rItem = static_cast<SvxFontHeightItem&>(rPoolItem);
+ assert(dynamic_cast<const SvxFontHeightItem *>(rPoolItem.get()) != nullptr);
+ SvxFontHeightItem& rItem = static_cast<SvxFontHeightItem&>(*rPoolItem);
rItem.SetHeight( OutputDevice::LogicToLogic( rItem.GetHeight(), eSourceUnit, eDestUnit ) );
}
break;
@@ -899,7 +899,7 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map
if ( eSourceUnit != eDestUnit )
{
std::unique_ptr<SfxPoolItem> pItem(rSource.Get( nSourceWhich ).Clone());
- ConvertItem( *pItem, eSourceUnit, eDestUnit );
+ ConvertItem( pItem, eSourceUnit, eDestUnit );
pItem->SetWhich(nWhich);
rDest.Put( *pItem );
}
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 9d7ea22183e3..9f0e27909515 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -1225,7 +1225,7 @@ inline vcl::Cursor* ImpEditView::GetCursor()
return pCursor.get();
}
-void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit );
+void ConvertItem( std::unique_ptr<SfxPoolItem>& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit );
void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const MapUnit* pSourceUnit = nullptr, const MapUnit* pDestUnit = nullptr );
AsianCompressionFlags GetCharTypeForCompression( sal_Unicode cChar );
Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin );
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 1838a063359e..79ac6acbc61d 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1230,7 +1230,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject
else
{
std::unique_ptr<SfxPoolItem> pNew(rX.GetItem()->Clone());
- ConvertItem( *pNew, eSourceUnit, eDestUnit );
+ ConvertItem( pNew, eSourceUnit, eDestUnit );
pAttr = MakeCharAttrib( aEditDoc.GetItemPool(), *pNew, rX.GetStart()+nStartPos, rX.GetEnd()+nStartPos );
}
DBG_ASSERT( pAttr->GetEnd() <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribute does not fit! (1)" );
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index 04c844e99bdd..97c6f76457db 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -26,9 +26,6 @@
#include <tools/debug.hxx>
#include <vcl/dibtools.hxx>
-#define BULITEM_VERSION (sal_uInt16(2))
-
-
SvxBulletItem::SvxBulletItem( sal_uInt16 _nWhich )
: SfxPoolItem(_nWhich)
, aFont(OutputDevice::GetDefaultFont( DefaultFontType::FIXED, LANGUAGE_SYSTEM, GetDefaultFontFlags::NONE ))
@@ -69,12 +66,6 @@ SfxPoolItem* SvxBulletItem::Clone( SfxItemPool * /*pPool*/ ) const
}
-sal_uInt16 SvxBulletItem::GetVersion( sal_uInt16 /*nVersion*/ ) const
-{
- return BULITEM_VERSION;
-}
-
-
void SvxBulletItem::CopyValidProperties( const SvxBulletItem& rCopyFrom )
{
vcl::Font _aFont = GetFont();
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index e384f8503d74..ac78520bdaa8 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -96,58 +96,6 @@ using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::table::BorderLineStyle;
-/*
-SvxBorderLine is not an SfxPoolItem, and has no Store/Create serialization/deserialization methods.
-Since border line information needs to be serialized by the table autoformat code, these file-local
-methods are defined to encapsulate the necessary serialization logic.
-*/
-namespace
-{
- /// Item version for saved border lines. The old version saves the line without style information.
- const int BORDER_LINE_OLD_VERSION = 0;
- /// Item version for saved border lies. The new version includes line style.
- const int BORDER_LINE_WITH_STYLE_VERSION = 1;
-
- /// Store a border line to a stream.
- SvStream& StoreBorderLine(SvStream &stream, const SvxBorderLine &l, sal_uInt16 version)
- {
- WriteColor( stream, l.GetColor() );
- stream.WriteUInt16( l.GetOutWidth() )
- .WriteUInt16( l.GetInWidth() )
- .WriteUInt16( l.GetDistance() );
-
- if (version >= BORDER_LINE_WITH_STYLE_VERSION)
- stream.WriteUInt16( static_cast<sal_uInt16>(l.GetBorderLineStyle()) );
-
- return stream;
- }
-
-
- /// Creates a border line from a stream.
- SvxBorderLine CreateBorderLine(SvStream &stream, sal_uInt16 version)
- {
- sal_uInt16 nOutline, nInline, nDistance;
- sal_uInt16 nStyle = css::table::BorderLineStyle::NONE;
- Color aColor;
- ReadColor( stream, aColor ).ReadUInt16( nOutline ).ReadUInt16( nInline ).ReadUInt16( nDistance );
-
- if (version >= BORDER_LINE_WITH_STYLE_VERSION)
- stream.ReadUInt16( nStyle );
-
- SvxBorderLine border(&aColor);
- border.GuessLinesWidths(static_cast<SvxBorderLineStyle>(nStyle), nOutline, nInline, nDistance);
- return border;
- }
-
-
- /// Retrieves a BORDER_LINE_* version from a BOX_BORDER_* version.
- sal_uInt16 BorderLineVersionFromBoxVersion(sal_uInt16 boxVersion)
- {
- return (boxVersion >= BOX_BORDER_STYLE_VERSION)? BORDER_LINE_WITH_STYLE_VERSION : BORDER_LINE_OLD_VERSION;
- }
-}
-
-
SfxPoolItem* SvxPaperBinItem::CreateDefault() { return new SvxPaperBinItem(0);}
SfxPoolItem* SvxSizeItem::CreateDefault() { return new SvxSizeItem(0);}
SfxPoolItem* SvxLRSpaceItem::CreateDefault() { return new SvxLRSpaceItem(0);}
@@ -647,14 +595,6 @@ bool SvxLRSpaceItem::GetPresentation
}
-sal_uInt16 SvxLRSpaceItem::GetVersion( sal_uInt16 nFileVersion ) const
-{
- return (nFileVersion == SOFFICE_FILEFORMAT_31)
- ? LRSPACE_TXTLEFT_VERSION
- : LRSPACE_NEGATIVE_VERSION;
-}
-
-
void SvxLRSpaceItem::ScaleMetrics( long nMult, long nDiv )
{
nFirstLineOfst = static_cast<short>(Scale( nFirstLineOfst, nMult, nDiv ));
@@ -883,12 +823,6 @@ bool SvxULSpaceItem::GetPresentation
}
-sal_uInt16 SvxULSpaceItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
-{
- return ULSPACE_16_VERSION;
-}
-
-
void SvxULSpaceItem::ScaleMetrics( long nMult, long nDiv )
{
nUpper = static_cast<sal_uInt16>(Scale( nUpper, nMult, nDiv ));
@@ -1274,18 +1208,6 @@ bool SvxShadowItem::GetPresentation
}
-SvStream& SvxShadowItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
-{
- rStrm.WriteSChar( static_cast<sal_uInt8>(GetLocation()) )
- .WriteUInt16( GetWidth() )
- .WriteBool( aShadowColor.GetTransparency() > 0 );
- WriteColor( rStrm, GetColor() );
- WriteColor( rStrm, GetColor() );
- rStrm.WriteSChar( aShadowColor.GetTransparency() > 0 ? 0 : 1 ); //BRUSH_NULL : BRUSH_SOLID
- return rStrm;
-}
-
-
void SvxShadowItem::ScaleMetrics( long nMult, long nDiv )
{
nWidth = static_cast<sal_uInt16>(Scale( nWidth, nMult, nDiv ));
@@ -1298,23 +1220,6 @@ bool SvxShadowItem::HasMetrics() const
}
-SfxPoolItem* SvxShadowItem::Create( SvStream& rStrm, sal_uInt16 ) const
-{
- sal_Int8 cLoc;
- sal_uInt16 _nWidth;
- bool bTrans;
- Color aColor;
- Color aFillColor;
- sal_Int8 nStyle;
- rStrm.ReadSChar( cLoc ).ReadUInt16( _nWidth )
- .ReadCharAsBool( bTrans );
- ReadColor( rStrm, aColor );
- ReadColor( rStrm, aFillColor ).ReadSChar( nStyle );
- aColor.SetTransparency(bTrans ? 0xff : 0);
- return new SvxShadowItem( Which(), &aColor, _nWidth, static_cast<SvxShadowLocation>(cLoc) );
-}
-
-
sal_uInt16 SvxShadowItem::GetValueCount() const
{
return sal_uInt16(SvxShadowLocation::End); // SvxShadowLocation::BottomRight + 1
@@ -1376,21 +1281,6 @@ SvxBoxItem::~SvxBoxItem()
}
-SvxBoxItem& SvxBoxItem::operator=( const SvxBoxItem& rBox )
-{
- nTopDist = rBox.nTopDist;
- nBottomDist = rBox.nBottomDist;
- nLeftDist = rBox.nLeftDist;
- nRightDist = rBox.nRightDist;
- bRemoveAdjCellBorder = rBox.bRemoveAdjCellBorder;
- SetLine( rBox.GetTop(), SvxBoxItemLine::TOP );
- SetLine( rBox.GetBottom(), SvxBoxItemLine::BOTTOM );
- SetLine( rBox.GetLeft(), SvxBoxItemLine::LEFT );
- SetLine( rBox.GetRight(), SvxBoxItemLine::RIGHT );
- return *this;
-}
-
-
static bool CmpBrdLn( const std::unique_ptr<SvxBorderLine> & pBrd1, const SvxBorderLine* pBrd2 )
{
if( pBrd1.get() == pBrd2 )
@@ -1946,58 +1836,6 @@ bool SvxBoxItem::GetPresentation
}
-SvStream& SvxBoxItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const
-{
- rStrm.WriteUInt16( GetSmallestDistance() );
- const SvxBorderLine* pLine[ 4 ]; // top, left, right, bottom
- pLine[ 0 ] = GetTop();
- pLine[ 1 ] = GetLeft();
- pLine[ 2 ] = GetRight();
- pLine[ 3 ] = GetBottom();
-
- for( int i = 0; i < 4; i++ )
- {
- const SvxBorderLine* l = pLine[ i ];
- if( l )
- {
- rStrm.WriteSChar(i);
- StoreBorderLine(rStrm, *l, BorderLineVersionFromBoxVersion(nItemVersion));
- }
- }
- sal_Int8 cLine = 4;
- if( nItemVersion >= BOX_4DISTS_VERSION &&
- !(nTopDist == nLeftDist &&
- nTopDist == nRightDist &&
- nTopDist == nBottomDist) )
- {
- cLine |= 0x10;
- }
-
- rStrm.WriteSChar( cLine );
-
- if( nItemVersion >= BOX_4DISTS_VERSION && (cLine & 0x10) != 0 )
- {
- rStrm.WriteUInt16( nTopDist )
- .WriteUInt16( nLeftDist )
- .WriteUInt16( nRightDist )
- .WriteUInt16( nBottomDist );
- }
-
- return rStrm;
-}
-
-
-sal_uInt16 SvxBoxItem::GetVersion( sal_uInt16 nFFVer ) const
-{
- DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer ||
- SOFFICE_FILEFORMAT_40==nFFVer ||
- SOFFICE_FILEFORMAT_50==nFFVer,
- "SvxBoxItem: Is there a new file format?" );
- return SOFFICE_FILEFORMAT_31==nFFVer ||
- SOFFICE_FILEFORMAT_40==nFFVer ? 0 : BOX_BORDER_STYLE_VERSION;
-}
-
-
void SvxBoxItem::ScaleMetrics( long nMult, long nDiv )
{
if ( pTop ) pTop->ScaleMetrics( nMult, nDiv );
@@ -2017,45 +1855,6 @@ bool SvxBoxItem::HasMetrics() const
}
-SfxPoolItem* SvxBoxItem::Create( SvStream& rStrm, sal_uInt16 nIVersion ) const
-{
- sal_uInt16 nDistance;
- rStrm.ReadUInt16( nDistance );
- SvxBoxItem* pAttr = new SvxBoxItem( Which() );
-
- SvxBoxItemLine aLineMap[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
- SvxBoxItemLine::RIGHT, SvxBoxItemLine::BOTTOM };
-
- sal_Int8 cLine(0);
- while (rStrm.good())
- {
- rStrm.ReadSChar( cLine );
-
- if( cLine > 3 )
- break;
-
- SvxBorderLine aBorder = CreateBorderLine(rStrm, BorderLineVersionFromBoxVersion(nIVersion));
- pAttr->SetLine( &aBorder, aLineMap[cLine] );
- }
-
- if( nIVersion >= BOX_4DISTS_VERSION && (cLine&0x10) != 0 )
- {
- for(SvxBoxItemLine & i : aLineMap)
- {
- sal_uInt16 nDist;
- rStrm.ReadUInt16( nDist );
- pAttr->SetDistance( nDist, i );
- }
- }
- else
- {
- pAttr->SetAllDistances(nDistance);
- }
-
- return pAttr;
-}
-
-
const SvxBorderLine *SvxBoxItem::GetLine( SvxBoxItemLine nLine ) const
{
const SvxBorderLine *pRet = nullptr;
@@ -2269,22 +2068,6 @@ SvxBoxInfoItem::~SvxBoxInfoItem()
{
}
-SvxBoxInfoItem &SvxBoxInfoItem::operator=( const SvxBoxInfoItem& rCpy )
-{
- if (this != &rCpy)
- {
- pHori.reset( rCpy.GetHori() ? new SvxBorderLine( *rCpy.GetHori() ) : nullptr );
- pVert.reset( rCpy.GetVert() ? new SvxBorderLine( *rCpy.GetVert() ) : nullptr );
- mbEnableHor = rCpy.mbEnableHor;
- mbEnableVer = rCpy.mbEnableVer;
- bDist = rCpy.IsDist();
- bMinDist = rCpy.IsMinDist();
- nValidFlags = rCpy.nValidFlags;
- nDefDist = rCpy.GetDefDist();
- }
- return *this;
-}
-
bool SvxBoxInfoItem::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
@@ -2802,36 +2585,6 @@ SfxPoolItem* SvxFormatBreakItem::Clone( SfxItemPool* ) const
}
-SvStream& SvxFormatBreakItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const
-{
- rStrm.WriteSChar( GetEnumValue() );
- if( FMTBREAK_NOAUTO > nItemVersion )
- rStrm.WriteSChar( 0x01 );
- return rStrm;
-}
-
-
-sal_uInt16 SvxFormatBreakItem::GetVersion( sal_uInt16 nFFVer ) const
-{
- DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer ||
- SOFFICE_FILEFORMAT_40==nFFVer ||
- SOFFICE_FILEFORMAT_50==nFFVer,
- "SvxFormatBreakItem: Is there a new file format? ");
- return SOFFICE_FILEFORMAT_31==nFFVer ||
- SOFFICE_FILEFORMAT_40==nFFVer ? 0 : FMTBREAK_NOAUTO;
-}
-
-
-SfxPoolItem* SvxFormatBreakItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) const
-{
- sal_Int8 eBreak, bDummy;
- rStrm.ReadSChar( eBreak );
- if( FMTBREAK_NOAUTO > nVersion )
- rStrm.ReadSChar( bDummy );
- return new SvxFormatBreakItem( static_cast<SvxBreak>(eBreak), Which() );
-}
-
-
sal_uInt16 SvxFormatBreakItem::GetValueCount() const
{
return sal_uInt16(SvxBreak::End); // SvxBreak::PageBoth + 1
@@ -2844,21 +2597,6 @@ SfxPoolItem* SvxFormatKeepItem::Clone( SfxItemPool* ) const
}
-SvStream& SvxFormatKeepItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
-{
- rStrm.WriteSChar( static_cast<sal_Int8>(GetValue()) );
- return rStrm;
-}
-
-
-SfxPoolItem* SvxFormatKeepItem::Create( SvStream& rStrm, sal_uInt16 ) const
-{
- sal_Int8 bIsKeep;
- rStrm.ReadSChar( bIsKeep );
- return new SvxFormatKeepItem( bIsKeep != 0, Which() );
-}
-
-
bool SvxFormatKeepItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -2894,14 +2632,6 @@ SvxLineItem::~SvxLineItem()
}
-SvxLineItem& SvxLineItem::operator=( const SvxLineItem& rLine )
-{
- SetLine( rLine.GetLine() );
-
- return *this;
-}
-
-
bool SvxLineItem::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
@@ -3001,24 +2731,6 @@ bool SvxLineItem::GetPresentation
}
-SvStream& SvxLineItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
-{
- if( pLine )
- {
- WriteColor( rStrm, pLine->GetColor() );
- rStrm.WriteInt16( pLine->GetOutWidth() )
- .WriteInt16( pLine->GetInWidth() )
- .WriteInt16( pLine->GetDistance() );
- }
- else
- {
- WriteColor( rStrm, Color() );
- rStrm.WriteInt16( 0 ).WriteInt16( 0 ).WriteInt16( 0 );
- }
- return rStrm;
-}
-
-
void SvxLineItem::ScaleMetrics( long nMult, long nDiv )
{
if ( pLine ) pLine->ScaleMetrics( nMult, nDiv );
@@ -3031,31 +2743,11 @@ bool SvxLineItem::HasMetrics() const
}
-SfxPoolItem* SvxLineItem::Create( SvStream& rStrm, sal_uInt16 ) const
-{
- SvxLineItem* _pLine = new SvxLineItem( Which() );
- short nOutline, nInline, nDistance;
- Color aColor;
-
- ReadColor( rStrm, aColor ).ReadInt16( nOutline ).ReadInt16( nInline ).ReadInt16( nDistance );
- if( nOutline )
- {
- SvxBorderLine aLine( &aColor );
- aLine.GuessLinesWidths(SvxBorderLineStyle::NONE, nOutline, nInline, nDistance);
- _pLine->SetLine( &aLine );
- }
- return _pLine;
-}
-
void SvxLineItem::SetLine( const SvxBorderLine* pNew )
{
pLine.reset( pNew ? new SvxBorderLine( *pNew ) : nullptr );
}
-#define LOAD_GRAPHIC (sal_uInt16(0x0001))
-#define LOAD_LINK (sal_uInt16(0x0002))
-#define LOAD_FILTER (sal_uInt16(0x0004))
-
SvxBrushItem::SvxBrushItem(sal_uInt16 _nWhich)
: SfxPoolItem(_nWhich)
, aColor(COL_TRANSPARENT)
@@ -3114,115 +2806,6 @@ SvxBrushItem::SvxBrushItem(const OUString& rLink, const OUString& rFilter,
DBG_ASSERT( GPOS_NONE != ePos, "SvxBrushItem-Ctor with GPOS_NONE == ePos" );
}
-SvxBrushItem::SvxBrushItem(SvStream& rStream, sal_uInt16 nVersion, sal_uInt16 _nWhich)
- : SfxPoolItem(_nWhich)
- , aColor(COL_TRANSPARENT)
- , nShadingValue(ShadingPattern::CLEAR)
- , nGraphicTransparency(0)
- , eGraphicPos(GPOS_NONE)
- , bLoadAgain(false)
-{
- bool bTrans;
- Color aTempColor;
- Color aTempFillColor;
- sal_Int8 nStyle;
-
- rStream.ReadCharAsBool( bTrans );
- ReadColor( rStream, aTempColor );
- ReadColor( rStream, aTempFillColor );
- rStream.ReadSChar( nStyle );
-
- switch ( nStyle )
- {
- case 8: // BRUSH_25:
- {
- sal_uInt32 nRed = aTempColor.GetRed();
- sal_uInt32 nGreen = aTempColor.GetGreen();
- sal_uInt32 nBlue = aTempColor.GetBlue();
- nRed += static_cast<sal_uInt32>(aTempFillColor.GetRed())*2;
- nGreen += static_cast<sal_uInt32>(aTempFillColor.GetGreen())*2;
- nBlue += static_cast<sal_uInt32>(aTempFillColor.GetBlue())*2;
- aColor = Color( static_cast<sal_Int8>(nRed/3), static_cast<sal_Int8>(nGreen/3), static_cast<sal_Int8>(nBlue/3) );
- }
- break;
-
- case 9: // BRUSH_50:
- {
- sal_uInt32 nRed = aTempColor.GetRed();
- sal_uInt32 nGreen = aTempColor.GetGreen();
- sal_uInt32 nBlue = aTempColor.GetBlue();
- nRed += static_cast<sal_uInt32>(aTempFillColor.GetRed());
- nGreen += static_cast<sal_uInt32>(aTempFillColor.GetGreen());
- nBlue += static_cast<sal_uInt32>(aTempFillColor.GetBlue());
- aColor = Color( static_cast<sal_Int8>(nRed/2), static_cast<sal_Int8>(nGreen/2), static_cast<sal_Int8>(nBlue/2) );
- }
- break;
-
- case 10: // BRUSH_75:
- {
- sal_uInt32 nRed = aTempColor.GetRed()*2;
- sal_uInt32 nGreen = aTempColor.GetGreen()*2;
- sal_uInt32 nBlue = aTempColor.GetBlue()*2;
- nRed += static_cast<sal_uInt32>(aTempFillColor.GetRed());
- nGreen += static_cast<sal_uInt32>(aTempFillColor.GetGreen());
- nBlue += static_cast<sal_uInt32>(aTempFillColor.GetBlue());
- aColor = Color( static_cast<sal_Int8>(nRed/3), static_cast<sal_Int8>(nGreen/3), static_cast<sal_Int8>(nBlue/3) );
- }
- break;
-
- case 0: // BRUSH_NULL:
- aColor = COL_TRANSPARENT;
- break;
-
- default:
- aColor = aTempColor;
- }
-
- if ( nVersion >= BRUSH_GRAPHIC_VERSION )
- {
- sal_uInt16 nDoLoad = 0;
- sal_Int8 nPos;
-
- rStream.ReadUInt16( nDoLoad );
-
- if ( nDoLoad & LOAD_GRAPHIC )
- {
- Graphic aGraphic;
-
- ReadGraphic( rStream, aGraphic );
- xGraphicObject.reset(new GraphicObject(aGraphic));
-
- if( SVSTREAM_FILEFORMAT_ERROR == rStream.GetError() )
- {
- rStream.ResetError();
- rStream.SetError( ERRCODE_SVX_GRAPHIC_WRONG_FILEFORMAT.MakeWarning() );
- }
- }
-
- if ( nDoLoad & LOAD_LINK )
- {
- // UNICODE: rStream >> aRel;
- OUString aRel = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
-
- // TODO/MBA: how can we get a BaseURL here?!
- OSL_FAIL("No BaseURL!");
- OUString aAbs = INetURLObject::GetAbsURL( "", aRel );
- DBG_ASSERT( !aAbs.isEmpty(), "Invalid URL!" );
- maStrLink = aAbs;
- }
-
- if ( nDoLoad & LOAD_FILTER )
- {
- // UNICODE: rStream >> maStrFilter;
- maStrFilter = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
- }
-
- rStream.ReadSChar( nPos );
-
- eGraphicPos = static_cast<SvxGraphicPosition>(nPos);
- }
-}
-
SvxBrushItem::SvxBrushItem(const SvxBrushItem& rItem)
: SfxPoolItem(rItem)
, aColor(rItem.aColor)
@@ -3269,11 +2852,6 @@ bool SvxBrushItem::isUsed() const
return false;
}
-sal_uInt16 SvxBrushItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
-{
- return BRUSH_GRAPHIC_VERSION;
-}
-
static sal_Int8 lcl_PercentToTransparency(long nPercent)
{
@@ -3498,35 +3076,6 @@ bool SvxBrushItem::GetPresentation
return true;
}
-SvxBrushItem& SvxBrushItem::operator=(const SvxBrushItem& rItem)
-{
- if (&rItem != this)
- {
- aColor = rItem.aColor;
- nShadingValue = rItem.nShadingValue;
- xGraphicObject.reset(rItem.xGraphicObject ? new GraphicObject(*rItem.xGraphicObject) : nullptr);
- nGraphicTransparency = rItem.nGraphicTransparency;
- maStrLink = rItem.maStrLink;
- maStrFilter = rItem.maStrFilter;
- eGraphicPos = rItem.eGraphicPos;
- bLoadAgain = rItem.bLoadAgain;
- }
- return *this;
-}
-
-SvxBrushItem& SvxBrushItem::operator=(SvxBrushItem&& rItem)
-{
- aColor = std::move(rItem.aColor);
- nShadingValue = std::move(rItem.nShadingValue);
- xGraphicObject = std::move(rItem.xGraphicObject);
- nGraphicTransparency = std::move(rItem.nGraphicTransparency);
- maStrLink = std::move(rItem.maStrLink);
- maStrFilter = std::move(rItem.maStrFilter);
- eGraphicPos = std::move(rItem.eGraphicPos);
- bLoadAgain = std::move(rItem.bLoadAgain);
- return *this;
-}
-
bool SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
@@ -3572,48 +3121,6 @@ SfxPoolItem* SvxBrushItem::Clone( SfxItemPool* ) const
}
-SfxPoolItem* SvxBrushItem::Create( SvStream& rStream, sal_uInt16 nVersion ) const
-{
- return new SvxBrushItem( rStream, nVersion, Which() );
-}
-
-
-SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ ) const
-{
- rStream.WriteBool( false );
- WriteColor( rStream, aColor );
- WriteColor( rStream, aColor );
- rStream.WriteSChar( aColor.GetTransparency() > 0 ? 0 : 1 ); //BRUSH_NULL : BRUSH_SOLID
-
- sal_uInt16 nDoLoad = 0;
-
- if (xGraphicObject && maStrLink.isEmpty())
- nDoLoad |= LOAD_GRAPHIC;
- if ( !maStrLink.isEmpty() )
- nDoLoad |= LOAD_LINK;
- if ( !maStrFilter.isEmpty() )
- nDoLoad |= LOAD_FILTER;
- rStream.WriteUInt16( nDoLoad );
-
- if (xGraphicObject && maStrLink.isEmpty())
- WriteGraphic(rStream, xGraphicObject->GetGraphic());
- if ( !maStrLink.isEmpty() )
- {
- OSL_FAIL("No BaseURL!");
- // TODO/MBA: how to get a BaseURL?!
- OUString aRel = INetURLObject::GetRelURL( "", maStrLink );
- // UNICODE: rStream << aRel;
- rStream.WriteUniOrByteString(aRel, rStream.GetStreamCharSet());
- }
- if ( !maStrFilter.isEmpty() )
- {
- // UNICODE: rStream << maStrFilter;
- rStream.WriteUniOrByteString(maStrFilter, rStream.GetStreamCharSet());
- }
- rStream.WriteSChar( eGraphicPos );
- return rStream;
-}
-
const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) const
{
if (bLoadAgain && !maStrLink.isEmpty() && !xGraphicObject)
@@ -3812,18 +3319,6 @@ SfxPoolItem* SvxFrameDirectionItem::Clone( SfxItemPool * ) const
}
-SfxPoolItem* SvxFrameDirectionItem::Create( SvStream & rStrm, sal_uInt16 /*nVer*/ ) const
-{
- sal_uInt16 nValue;
- rStrm.ReadUInt16( nValue );
- return new SvxFrameDirectionItem( static_cast<SvxFrameDirection>(nValue), Which() );
-}
-
-sal_uInt16 SvxFrameDirectionItem::GetVersion( sal_uInt16 nFVer ) const
-{
- return SOFFICE_FILEFORMAT_50 > nFVer ? USHRT_MAX : 0;
-}
-
const char* getFrmDirResId(size_t nIndex)
{
const char* const RID_SVXITEMS_FRMDIR[] =
diff --git a/editeng/source/items/justifyitem.cxx b/editeng/source/items/justifyitem.cxx
index d010f72d58b1..1b9701356bdc 100644
--- a/editeng/source/items/justifyitem.cxx
+++ b/editeng/source/items/justifyitem.cxx
@@ -171,15 +171,6 @@ SfxPoolItem* SvxHorJustifyItem::Clone( SfxItemPool* ) const
return new SvxHorJustifyItem( *this );
}
-
-SfxPoolItem* SvxHorJustifyItem::Create( SvStream& rStream, sal_uInt16 ) const
-{
- sal_uInt16 nVal;
- rStream.ReadUInt16( nVal );
- return new SvxHorJustifyItem( static_cast<SvxCellHorJustify>(nVal), Which() );
-}
-
-
sal_uInt16 SvxHorJustifyItem::GetValueCount() const
{
return sal_uInt16(SvxCellHorJustify::Repeat) + 1; // Last Enum value + 1
@@ -308,14 +299,6 @@ SfxPoolItem* SvxVerJustifyItem::Clone( SfxItemPool* ) const
}
-SfxPoolItem* SvxVerJustifyItem::Create( SvStream& rStream, sal_uInt16 ) const
-{
- sal_uInt16 nVal;
- rStream.ReadUInt16( nVal );
- return new SvxVerJustifyItem( static_cast<SvxCellVerJustify>(nVal), Which() );
-}
-
-
sal_uInt16 SvxVerJustifyItem::GetValueCount() const
{
return static_cast<sal_uInt16>(SvxCellVerJustify::Bottom) + 1; // Last Enum value + 1
diff --git a/editeng/source/items/legacyitem.cxx b/editeng/source/items/legacyitem.cxx
new file mode 100755
index 000000000000..9a4acfafcead
--- /dev/null
+++ b/editeng/source/items/legacyitem.cxx
@@ -0,0 +1,807 @@
+/* -*- 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 <editeng/legacyitem.hxx>
+#include <unotools/fontdefs.hxx>
+#include <tools/tenccvt.hxx>
+#include <tools/stream.hxx>
+#include <comphelper/fileformat.h>
+#include <vcl/graph.hxx>
+#include <vcl/GraphicObject.hxx>
+#include <osl/diagnose.h>
+#include <tools/urlobj.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/colritem.hxx>
+#include <editeng/boxitem.hxx>
+#include <editeng/borderline.hxx>
+#include <editeng/lineitem.hxx>
+#include <editeng/brushitem.hxx>
+#include <editeng/editerr.hxx>
+#include <editeng/adjustitem.hxx>
+#include <editeng/justifyitem.hxx>
+#include <editeng/frmdiritem.hxx>
+#include <editeng/formatbreakitem.hxx>
+#include <editeng/keepitem.hxx>
+#include <editeng/shaditem.hxx>
+
+void Create_legacy_direct_set(SvxFontHeightItem& rItem, sal_uInt32 nH, sal_uInt16 nP, MapUnit eP)
+{
+ rItem.legacy_direct_set(nH, nP, eP);
+}
+
+namespace legacy
+{
+ namespace SvxFont
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxFontItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_uInt8 _eFamily, eFontPitch, eFontTextEncoding;
+ OUString aName, aStyle;
+ rStrm.ReadUChar( _eFamily );
+ rStrm.ReadUChar( eFontPitch );
+ rStrm.ReadUChar( eFontTextEncoding );
+
+ // UNICODE: rStrm >> aName;
+ aName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
+
+ // UNICODE: rStrm >> aStyle;
+ aStyle = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
+
+ // Set the "correct" textencoding
+ eFontTextEncoding = static_cast<sal_uInt8>(GetSOLoadTextEncoding( eFontTextEncoding ));
+
+ // at some point, the StarBats changes from ANSI font to SYMBOL font
+ if ( RTL_TEXTENCODING_SYMBOL != eFontTextEncoding && aName == "StarBats" )
+ eFontTextEncoding = RTL_TEXTENCODING_SYMBOL;
+
+ // Check if we have stored unicode
+ sal_uInt64 const nStreamPos = rStrm.Tell();
+ // #define STORE_UNICODE_MAGIC_MARKER 0xFE331188
+ sal_uInt32 nMagic = 0xFE331188;
+ rStrm.ReadUInt32( nMagic );
+ if ( nMagic == 0xFE331188 )
+ {
+ aName = rStrm.ReadUniOrByteString( RTL_TEXTENCODING_UNICODE );
+ aStyle = rStrm.ReadUniOrByteString( RTL_TEXTENCODING_UNICODE );
+ }
+ else
+ {
+ rStrm.Seek( nStreamPos );
+ }
+
+ rItem.SetFamilyName(aName);
+ rItem.SetStyleName(aStyle);
+ rItem.SetFamily(static_cast<FontFamily>(_eFamily));
+ rItem.SetPitch(static_cast<FontPitch>(eFontPitch));
+ rItem.SetCharSet(static_cast<rtl_TextEncoding>(eFontTextEncoding));
+ }
+
+ SvStream& Store(const SvxFontItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ const bool bToBats(IsStarSymbol(rItem.GetFamilyName()));
+
+ rStrm.WriteUChar(rItem.GetFamily()).WriteUChar(rItem.GetPitch()).WriteUChar(bToBats ?
+ RTL_TEXTENCODING_SYMBOL :
+ GetSOStoreTextEncoding(rItem.GetCharSet()));
+
+ const OUString aStoreFamilyName(bToBats ? "StarBats" : rItem.GetFamilyName());
+
+ rStrm.WriteUniOrByteString(aStoreFamilyName, rStrm.GetStreamCharSet());
+ rStrm.WriteUniOrByteString(rItem.GetStyleName(), rStrm.GetStreamCharSet());
+
+ return rStrm;
+ }
+ }
+
+ namespace SvxFontHeight
+ {
+ sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion)
+ {
+ return (nFileFormatVersion <= SOFFICE_FILEFORMAT_40)
+ ? FONTHEIGHT_16_VERSION
+ : FONTHEIGHT_UNIT_VERSION;
+ }
+
+ void Create(SvxFontHeightItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion)
+ {
+ sal_uInt16 nsize, nprop = 0;
+ MapUnit nPropUnit = MapUnit::MapRelative;
+
+ rStrm.ReadUInt16( nsize );
+
+ if( FONTHEIGHT_16_VERSION <= nItemVersion )
+ rStrm.ReadUInt16( nprop );
+ else
+ {
+ sal_uInt8 nP;
+ rStrm .ReadUChar( nP );
+ nprop = static_cast<sal_uInt16>(nP);
+ }
+
+ if( FONTHEIGHT_UNIT_VERSION <= nItemVersion )
+ {
+ sal_uInt16 nTmp;
+ rStrm.ReadUInt16( nTmp );
+ nPropUnit = static_cast<MapUnit>(nTmp);
+ }
+
+ Create_legacy_direct_set(rItem, nsize, nprop, nPropUnit);
+ }
+
+ SvStream& Store(const SvxFontHeightItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion)
+ {
+ rStrm.WriteUInt16( rItem.GetHeight() );
+
+ if( FONTHEIGHT_UNIT_VERSION <= nItemVersion )
+ rStrm.WriteUInt16( rItem.GetProp() ).WriteUInt16( static_cast<sal_uInt16>(rItem.GetPropUnit()) );
+ else
+ {
+ // When exporting to the old versions the relative information is lost
+ // when there is no percentage
+ sal_uInt16 _nProp = rItem.GetProp();
+ if( MapUnit::MapRelative != rItem.GetPropUnit() )
+ _nProp = 100;
+ rStrm.WriteUInt16( _nProp );
+ }
+ return rStrm;
+ }
+ }
+
+ namespace SvxWeight
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxWeightItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_uInt8 nWeight(0);
+ rStrm.ReadUChar(nWeight);
+ rItem.SetValue(static_cast<FontWeight>(nWeight));
+ }
+
+ SvStream& Store(const SvxWeightItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteUChar(rItem.GetValue());
+ return rStrm;
+ }
+ }
+
+ namespace SvxPosture
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxPostureItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_uInt8 nPosture(0);
+ rStrm.ReadUChar(nPosture);
+ rItem.SetValue(static_cast<FontItalic>(nPosture));
+ }
+
+ SvStream& Store(const SvxPostureItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteUChar( rItem.GetValue() );
+ return rStrm;
+ }
+ }
+
+ namespace SvxTextLine // SvxUnderlineItem, SvxOverlineItem -> SvxTextLineItem
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxTextLineItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_uInt8 nState(0);
+ rStrm.ReadUChar(nState);
+ rItem.SetValue(static_cast<FontLineStyle>(nState));
+ // GetColor() is *not* saved/loaded ?!?
+ }
+
+ SvStream& Store(const SvxTextLineItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteUChar(rItem.GetValue());
+ // GetColor() is *not* saved/loaded ?!?
+ return rStrm;
+ }
+ }
+
+ namespace SvxCrossedOut
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxCrossedOutItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_uInt8 eCross(0);
+ rStrm.ReadUChar(eCross);
+ rItem.SetValue(static_cast<FontStrikeout>(eCross));
+ }
+
+ SvStream& Store(const SvxCrossedOutItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteUChar(rItem.GetValue());
+ return rStrm;
+ }
+ }
+
+ namespace SvxColor
+ {
+ sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion)
+ {
+ DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFileFormatVersion ||
+ SOFFICE_FILEFORMAT_40==nFileFormatVersion ||
+ SOFFICE_FILEFORMAT_50==nFileFormatVersion,
+ "SvxColorItem: Is there a new file format? ");
+ return SOFFICE_FILEFORMAT_50 >= nFileFormatVersion ? VERSION_USEAUTOCOLOR : 0;
+ }
+
+ void Create(SvxColorItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ Color aColor(COL_AUTO);
+ ReadColor(rStrm, aColor);
+ rItem.SetValue(aColor);
+ }
+
+ SvStream& Store(const SvxColorItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion)
+ {
+ if( VERSION_USEAUTOCOLOR == nItemVersion && COL_AUTO == rItem.GetValue() )
+ WriteColor( rStrm, COL_BLACK );
+ else
+ WriteColor( rStrm, rItem.GetValue() );
+ return rStrm;
+ }
+ }
+
+ namespace SvxBox
+ {
+ sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion)
+ {
+ DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFileFormatVersion ||
+ SOFFICE_FILEFORMAT_40==nFileFormatVersion ||
+ SOFFICE_FILEFORMAT_50==nFileFormatVersion,
+ "SvxBoxItem: Is there a new file format?" );
+ return SOFFICE_FILEFORMAT_31==nFileFormatVersion ||
+ SOFFICE_FILEFORMAT_40==nFileFormatVersion ? 0 : BOX_BORDER_STYLE_VERSION;
+ }
+
+ /// Item version for saved border lines. The old version saves the line without style information.
+ const int BORDER_LINE_OLD_VERSION = 0;
+ /// Item version for saved border lies. The new version includes line style.
+ const int BORDER_LINE_WITH_STYLE_VERSION = 1;
+
+ /// Creates a border line from a stream.
+ static ::editeng::SvxBorderLine CreateBorderLine(SvStream &stream, sal_uInt16 version)
+ {
+ sal_uInt16 nOutline, nInline, nDistance;
+ sal_uInt16 nStyle = css::table::BorderLineStyle::NONE;
+ Color aColor;
+ ReadColor( stream, aColor ).ReadUInt16( nOutline ).ReadUInt16( nInline ).ReadUInt16( nDistance );
+
+ if (version >= BORDER_LINE_WITH_STYLE_VERSION)
+ stream.ReadUInt16( nStyle );
+
+ ::editeng::SvxBorderLine border(&aColor);
+ border.GuessLinesWidths(static_cast<SvxBorderLineStyle>(nStyle), nOutline, nInline, nDistance);
+ return border;
+ }
+
+ /// Retrieves a BORDER_LINE_* version from a BOX_BORDER_* version.
+ static sal_uInt16 BorderLineVersionFromBoxVersion(sal_uInt16 boxVersion)
+ {
+ return (boxVersion >= BOX_BORDER_STYLE_VERSION)? BORDER_LINE_WITH_STYLE_VERSION : BORDER_LINE_OLD_VERSION;
+ }
+
+ void Create(SvxBoxItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion)
+ {
+ sal_uInt16 nDistance(0);
+ rStrm.ReadUInt16( nDistance );
+ SvxBoxItemLine aLineMap[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
+ SvxBoxItemLine::RIGHT, SvxBoxItemLine::BOTTOM };
+ sal_Int8 cLine(0);
+
+ while (rStrm.good())
+ {
+ rStrm.ReadSChar( cLine );
+
+ if( cLine > 3 )
+ break;
+
+ ::editeng::SvxBorderLine aBorder = CreateBorderLine(rStrm, BorderLineVersionFromBoxVersion(nItemVersion));
+ rItem.SetLine( &aBorder, aLineMap[cLine] );
+ }
+
+ if( nItemVersion >= BOX_4DISTS_VERSION && (cLine&0x10) != 0 )
+ {
+ for(SvxBoxItemLine & i : aLineMap)
+ {
+ sal_uInt16 nDist;
+ rStrm.ReadUInt16( nDist );
+ rItem.SetDistance( nDist, i );
+ }
+ }
+ else
+ {
+ rItem.SetAllDistances(nDistance);
+ }
+ }
+
+ /// Store a border line to a stream.
+ static SvStream& StoreBorderLine(SvStream &stream, const ::editeng::SvxBorderLine &l, sal_uInt16 version)
+ {
+ WriteColor( stream, l.GetColor() );
+ stream.WriteUInt16( l.GetOutWidth() )
+ .WriteUInt16( l.GetInWidth() )
+ .WriteUInt16( l.GetDistance() );
+
+ if (version >= BORDER_LINE_WITH_STYLE_VERSION)
+ stream.WriteUInt16( static_cast<sal_uInt16>(l.GetBorderLineStyle()) );
+
+ return stream;
+ }
+
+ SvStream& Store(const SvxBoxItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion)
+ {
+ rStrm.WriteUInt16( rItem.GetSmallestDistance() );
+ const ::editeng::SvxBorderLine* pLine[ 4 ]; // top, left, right, bottom
+ pLine[ 0 ] = rItem.GetTop();
+ pLine[ 1 ] = rItem.GetLeft();
+ pLine[ 2 ] = rItem.GetRight();
+ pLine[ 3 ] = rItem.GetBottom();
+
+ for( int i = 0; i < 4; i++ )
+ {
+ const ::editeng::SvxBorderLine* l = pLine[ i ];
+ if( l )
+ {
+ rStrm.WriteSChar(i);
+ StoreBorderLine(rStrm, *l, BorderLineVersionFromBoxVersion(nItemVersion));
+ }
+ }
+ sal_Int8 cLine = 4;
+ const sal_uInt16 nTopDist(rItem.GetDistance(SvxBoxItemLine::TOP));
+ const sal_uInt16 nLeftDist(rItem.GetDistance(SvxBoxItemLine::LEFT));
+ const sal_uInt16 nRightDist(rItem.GetDistance(SvxBoxItemLine::RIGHT));
+ const sal_uInt16 nBottomDist(rItem.GetDistance(SvxBoxItemLine::BOTTOM));
+
+ if( nItemVersion >= BOX_4DISTS_VERSION &&
+ !(nTopDist == nLeftDist &&
+ nTopDist == nRightDist &&
+ nTopDist == nBottomDist) )
+ {
+ cLine |= 0x10;
+ }
+
+ rStrm.WriteSChar( cLine );
+
+ if( nItemVersion >= BOX_4DISTS_VERSION && (cLine & 0x10) != 0 )
+ {
+ rStrm.WriteUInt16( nTopDist )
+ .WriteUInt16( nLeftDist )
+ .WriteUInt16( nRightDist )
+ .WriteUInt16( nBottomDist );
+ }
+
+ return rStrm;
+ }
+ }
+
+ namespace SvxLine
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxLineItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ short nOutline, nInline, nDistance;
+ Color aColor;
+
+ ReadColor( rStrm, aColor ).ReadInt16( nOutline ).ReadInt16( nInline ).ReadInt16( nDistance );
+ if( nOutline )
+ {
+ ::editeng::SvxBorderLine aLine( &aColor );
+ aLine.GuessLinesWidths(SvxBorderLineStyle::NONE, nOutline, nInline, nDistance);
+ rItem.SetLine( &aLine );
+ }
+ }
+
+ SvStream& Store(const SvxLineItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ const ::editeng::SvxBorderLine* pLine(rItem.GetLine());
+
+ if(nullptr != pLine)
+ {
+ WriteColor( rStrm, pLine->GetColor() );
+ rStrm.WriteInt16( pLine->GetOutWidth() )
+ .WriteInt16( pLine->GetInWidth() )
+ .WriteInt16( pLine->GetDistance() );
+ }
+ else
+ {
+ WriteColor( rStrm, Color() );
+ rStrm.WriteInt16( 0 ).WriteInt16( 0 ).WriteInt16( 0 );
+ }
+
+ return rStrm;
+ }
+ }
+
+ namespace SvxBrush
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return BRUSH_GRAPHIC_VERSION;
+ }
+
+ const sal_uInt16 LOAD_GRAPHIC = (sal_uInt16(0x0001));
+ const sal_uInt16 LOAD_LINK = (sal_uInt16(0x0002));
+ const sal_uInt16 LOAD_FILTER = (sal_uInt16(0x0004));
+
+ void Create(SvxBrushItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion)
+ {
+ bool bTrans;
+ Color aTempColor;
+ Color aTempFillColor;
+ sal_Int8 nStyle;
+
+ rStrm.ReadCharAsBool( bTrans );
+ ReadColor( rStrm, aTempColor );
+ ReadColor( rStrm, aTempFillColor );
+ rStrm.ReadSChar( nStyle );
+
+ switch ( nStyle )
+ {
+ case 8: // BRUSH_25:
+ {
+ sal_uInt32 nRed = aTempColor.GetRed();
+ sal_uInt32 nGreen = aTempColor.GetGreen();
+ sal_uInt32 nBlue = aTempColor.GetBlue();
+ nRed += static_cast<sal_uInt32>(aTempFillColor.GetRed())*2;
+ nGreen += static_cast<sal_uInt32>(aTempFillColor.GetGreen())*2;
+ nBlue += static_cast<sal_uInt32>(aTempFillColor.GetBlue())*2;
+ rItem.SetColor(Color( static_cast<sal_Int8>(nRed/3), static_cast<sal_Int8>(nGreen/3), static_cast<sal_Int8>(nBlue/3) ));
+ }
+ break;
+
+ case 9: // BRUSH_50:
+ {
+ sal_uInt32 nRed = aTempColor.GetRed();
+ sal_uInt32 nGreen = aTempColor.GetGreen();
+ sal_uInt32 nBlue = aTempColor.GetBlue();
+ nRed += static_cast<sal_uInt32>(aTempFillColor.GetRed());
+ nGreen += static_cast<sal_uInt32>(aTempFillColor.GetGreen());
+ nBlue += static_cast<sal_uInt32>(aTempFillColor.GetBlue());
+ rItem.SetColor(Color( static_cast<sal_Int8>(nRed/2), static_cast<sal_Int8>(nGreen/2), static_cast<sal_Int8>(nBlue/2) ));
+ }
+ break;
+
+ case 10: // BRUSH_75:
+ {
+ sal_uInt32 nRed = aTempColor.GetRed()*2;
+ sal_uInt32 nGreen = aTempColor.GetGreen()*2;
+ sal_uInt32 nBlue = aTempColor.GetBlue()*2;
+ nRed += static_cast<sal_uInt32>(aTempFillColor.GetRed());
+ nGreen += static_cast<sal_uInt32>(aTempFillColor.GetGreen());
+ nBlue += static_cast<sal_uInt32>(aTempFillColor.GetBlue());
+ rItem.SetColor(Color( static_cast<sal_Int8>(nRed/3), static_cast<sal_Int8>(nGreen/3), static_cast<sal_Int8>(nBlue/3) ));
+ }
+ break;
+
+ case 0: // BRUSH_NULL:
+ rItem.SetColor(COL_TRANSPARENT);
+ break;
+
+ default:
+ rItem.SetColor(aTempColor);
+ }
+
+ if ( nItemVersion >= BRUSH_GRAPHIC_VERSION )
+ {
+ sal_uInt16 nDoLoad = 0;
+ sal_Int8 nPos;
+
+ rStrm.ReadUInt16( nDoLoad );
+
+ if ( nDoLoad & LOAD_GRAPHIC )
+ {
+ Graphic aGraphic;
+
+ ReadGraphic( rStrm, aGraphic );
+ rItem.SetGraphicObject(GraphicObject(aGraphic));
+
+ if( SVSTREAM_FILEFORMAT_ERROR == rStrm.GetError() )
+ {
+ rStrm.ResetError();
+ rStrm.SetError( ERRCODE_SVX_GRAPHIC_WRONG_FILEFORMAT.MakeWarning() );
+ }
+ }
+
+ if ( nDoLoad & LOAD_LINK )
+ {
+ // UNICODE: rStrm >> aRel;
+ OUString aRel = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
+
+ // TODO/MBA: how can we get a BaseURL here?!
+ OSL_FAIL("No BaseURL!");
+ OUString aAbs = INetURLObject::GetAbsURL( "", aRel );
+ DBG_ASSERT( !aAbs.isEmpty(), "Invalid URL!" );
+ rItem.SetGraphicLink(aAbs);
+ }
+
+ if ( nDoLoad & LOAD_FILTER )
+ {
+ // UNICODE: rStrm >> maStrFilter;
+ rItem.SetGraphicFilter(rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet()));
+ }
+
+ rStrm.ReadSChar( nPos );
+
+ rItem.SetGraphicPos(static_cast<SvxGraphicPosition>(nPos));
+ }
+ }
+
+ SvStream& Store(const SvxBrushItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteBool( false );
+ WriteColor( rStrm, rItem.GetColor() );
+ WriteColor( rStrm, rItem.GetColor() );
+ rStrm.WriteSChar( rItem.GetColor().GetTransparency() > 0 ? 0 : 1 ); //BRUSH_NULL : BRUSH_SOLID
+
+ sal_uInt16 nDoLoad = 0;
+ const GraphicObject* pGraphicObject(rItem.GetGraphicObject());
+
+ if (nullptr != pGraphicObject && rItem.GetGraphicLink().isEmpty())
+ nDoLoad |= LOAD_GRAPHIC;
+ if ( !rItem.GetGraphicLink().isEmpty() )
+ nDoLoad |= LOAD_LINK;
+ if ( !rItem.GetGraphicFilter().isEmpty() )
+ nDoLoad |= LOAD_FILTER;
+ rStrm.WriteUInt16( nDoLoad );
+
+ if (nullptr != pGraphicObject && rItem.GetGraphicLink().isEmpty())
+ WriteGraphic(rStrm, pGraphicObject->GetGraphic());
+ if ( !rItem.GetGraphicLink().isEmpty() )
+ {
+ OSL_FAIL("No BaseURL!");
+ // TODO/MBA: how to get a BaseURL?!
+ OUString aRel = INetURLObject::GetRelURL( "", rItem.GetGraphicLink() );
+ // UNICODE: rStrm << aRel;
+ rStrm.WriteUniOrByteString(aRel, rStrm.GetStreamCharSet());
+ }
+ if ( !rItem.GetGraphicFilter().isEmpty() )
+ {
+ // UNICODE: rStrm << rItem.GetGraphicFilter();
+ rStrm.WriteUniOrByteString(rItem.GetGraphicFilter(), rStrm.GetStreamCharSet());
+ }
+ rStrm.WriteSChar( rItem.GetGraphicPos() );
+ return rStrm;
+ }
+ }
+
+ namespace SvxAdjust
+ {
+ sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion)
+ {
+ return (nFileFormatVersion == SOFFICE_FILEFORMAT_31)
+ ? 0 : ADJUST_LASTBLOCK_VERSION;
+ }
+
+ void Create(SvxAdjustItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion)
+ {
+ char eAdjustment;
+ rStrm.ReadChar(eAdjustment);
+ rItem.SetAdjust(static_cast<::SvxAdjust>(eAdjustment));
+
+ if( nItemVersion >= ADJUST_LASTBLOCK_VERSION )
+ {
+ sal_Int8 nFlags;
+ rStrm.ReadSChar( nFlags );
+ rItem.SetAsFlags(nFlags);
+ }
+ }
+
+ SvStream& Store(const SvxAdjustItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion)
+ {
+ rStrm.WriteChar( static_cast<char>(rItem.GetAdjust()) );
+ if ( nItemVersion >= ADJUST_LASTBLOCK_VERSION )
+ {
+ const sal_Int8 nFlags(rItem.GetAsFlags());
+ rStrm.WriteSChar( nFlags );
+ }
+ return rStrm;
+ }
+ }
+
+ namespace SvxHorJustify
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxHorJustifyItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_uInt16 nVal(0);
+ rStrm.ReadUInt16( nVal );
+ rItem.SetValue(static_cast<::SvxCellHorJustify>(nVal));
+ }
+
+ SvStream& Store(const SvxHorJustifyItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteUInt16( static_cast<sal_uInt16>(rItem.GetValue()) );
+ return rStrm;
+ }
+ }
+
+ namespace SvxVerJustify
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxVerJustifyItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_uInt16 nVal(0);
+ rStrm.ReadUInt16( nVal );
+ rItem.SetValue(static_cast<::SvxCellVerJustify>(nVal));
+ }
+
+ SvStream& Store(const SvxVerJustifyItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteUInt16( static_cast<sal_uInt16>(rItem.GetValue()) );
+ return rStrm;
+ }
+ }
+
+ namespace SvxFrameDirection
+ {
+ sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion)
+ {
+ return SOFFICE_FILEFORMAT_50 > nFileFormatVersion ? USHRT_MAX : 0;
+ }
+
+ void Create(SvxFrameDirectionItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_uInt16 nVal(0);
+ rStrm.ReadUInt16( nVal );
+ rItem.SetValue(static_cast<::SvxFrameDirection>(nVal));
+ }
+
+ SvStream& Store(const SvxFrameDirectionItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteUInt16( static_cast<sal_uInt16>(rItem.GetValue()) );
+ return rStrm;
+ }
+ }
+
+ namespace SvxFormatBreak
+ {
+ sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion)
+ {
+ DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFileFormatVersion ||
+ SOFFICE_FILEFORMAT_40==nFileFormatVersion ||
+ SOFFICE_FILEFORMAT_50==nFileFormatVersion,
+ "SvxFormatBreakItem: Is there a new file format? ");
+ return SOFFICE_FILEFORMAT_31==nFileFormatVersion ||
+ SOFFICE_FILEFORMAT_40==nFileFormatVersion ? 0 : FMTBREAK_NOAUTO;
+ }
+
+ void Create(SvxFormatBreakItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion)
+ {
+ sal_Int8 eBreak, bDummy;
+ rStrm.ReadSChar( eBreak );
+ if( FMTBREAK_NOAUTO > nItemVersion )
+ rStrm.ReadSChar( bDummy );
+ rItem.SetValue(static_cast<::SvxBreak>(eBreak));
+ }
+
+ SvStream& Store(const SvxFormatBreakItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion)
+ {
+ rStrm.WriteSChar( rItem.GetEnumValue() );
+ if( FMTBREAK_NOAUTO > nItemVersion )
+ rStrm.WriteSChar( 0x01 );
+ return rStrm;
+ }
+ }
+
+ namespace SvxFormatKeep
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxFormatKeepItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ // derived from SfxBoolItem, but that uses
+ // rStream.ReadCharAsBool( tmp );
+ sal_Int8 bIsKeep;
+ rStrm.ReadSChar( bIsKeep );
+ rItem.SetValue(static_cast<bool>(bIsKeep));
+ }
+
+ SvStream& Store(const SvxFormatKeepItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ // derived from SfxBoolItem, but that uses
+ // rStream.WriteBool( m_bValue ); // not bool for serialization!
+ rStrm.WriteSChar( static_cast<sal_Int8>(rItem.GetValue()) );
+ return rStrm;
+ }
+ }
+
+ namespace SvxShadow
+ {
+ sal_uInt16 GetVersion(sal_uInt16)
+ {
+ return 0;
+ }
+
+ void Create(SvxShadowItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ sal_Int8 cLoc;
+ sal_uInt16 _nWidth;
+ bool bTrans;
+ Color aColor;
+ Color aFillColor;
+ sal_Int8 nStyle;
+ rStrm.ReadSChar( cLoc ).ReadUInt16( _nWidth ).ReadCharAsBool( bTrans );
+ ReadColor( rStrm, aColor );
+ ReadColor( rStrm, aFillColor ).ReadSChar( nStyle );
+ aColor.SetTransparency(bTrans ? 0xff : 0);
+
+ rItem.SetLocation(static_cast<SvxShadowLocation>(cLoc));
+ rItem.SetWidth(_nWidth);
+ rItem.SetColor(aColor);
+ }
+
+ SvStream& Store(const SvxShadowItem& rItem, SvStream& rStrm, sal_uInt16)
+ {
+ rStrm.WriteSChar( static_cast<sal_uInt8>(rItem.GetLocation()) )
+ .WriteUInt16( rItem.GetWidth() )
+ .WriteBool( rItem.GetColor().GetTransparency() > 0 );
+ WriteColor( rStrm, rItem.GetColor() );
+ WriteColor( rStrm, rItem.GetColor() );
+ rStrm.WriteSChar( rItem.GetColor().GetTransparency() > 0 ? 0 : 1 ); //BRUSH_NULL : BRUSH_SOLID
+ return rStrm;
+ }
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index ddb1aa11926f..5a748f5a4414 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -53,6 +53,7 @@
#include <editeng/unonrule.hxx>
#include <sal/log.hxx>
#include <i18nlangtag/languagetag.hxx>
+#include <editeng/legacyitem.hxx>
#define DEF_WRITER_LSPACE 500 //Standard Indentation
#define DEF_DRAW_LSPACE 800 //Standard Indentation
@@ -217,8 +218,8 @@ SvxNumberFormat::SvxNumberFormat( SvStream &rStream )
rStream.ReadUInt16( hasGraphicBrush );
if ( hasGraphicBrush )
{
- std::unique_ptr<SvxBrushItem> pTmp( new SvxBrushItem( SID_ATTR_BRUSH ) );
- pGraphicBrush.reset( static_cast<SvxBrushItem*>(pTmp->Create( rStream, BRUSH_GRAPHIC_VERSION )) );
+ pGraphicBrush.reset(new SvxBrushItem(SID_ATTR_BRUSH));
+ legacy::SvxBrush::Create(*pGraphicBrush, rStream, BRUSH_GRAPHIC_VERSION);
}
else pGraphicBrush = nullptr;
rStream.ReadUInt16( nTmp16 ); eVertOrient = nTmp16;
@@ -290,7 +291,7 @@ void SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverte
pGraphicBrush->SetGraphicLink("");
}
- pGraphicBrush->Store(rStream, BRUSH_GRAPHIC_VERSION);
+ legacy::SvxBrush::Store(*pGraphicBrush, rStream, BRUSH_GRAPHIC_VERSION);
}
else
rStream.WriteUInt16( 0 );
@@ -939,11 +940,6 @@ SfxPoolItem* SvxNumBulletItem::Clone( SfxItemPool * ) const
return new SvxNumBulletItem(*this);
}
-sal_uInt16 SvxNumBulletItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
-{
- return NUMITEM_VERSION_03;
-}
-
bool SvxNumBulletItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
{
rVal <<= SvxCreateNumRule( pNumRule.get() );
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 3bd1449b7c0e..4cf9750f15ca 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -401,47 +401,6 @@ void SvxAdjustItem::SetEnumValue( sal_uInt16 nVal )
}
-sal_uInt16 SvxAdjustItem::GetVersion( sal_uInt16 nFileVersion ) const
-{
- return (nFileVersion == SOFFICE_FILEFORMAT_31)
- ? 0 : ADJUST_LASTBLOCK_VERSION;
-}
-
-
-SfxPoolItem* SvxAdjustItem::Create(SvStream& rStrm, sal_uInt16 nVersion) const
-{
- char eAdjustment;
- rStrm.ReadChar( eAdjustment );
- SvxAdjustItem *pRet = new SvxAdjustItem( static_cast<SvxAdjust>(eAdjustment), Which() );
- if( nVersion >= ADJUST_LASTBLOCK_VERSION )
- {
- sal_Int8 nFlags;
- rStrm.ReadSChar( nFlags );
- pRet->bOneBlock = 0 != (nFlags & 0x0001);
- pRet->bLastCenter = 0 != (nFlags & 0x0002);
- pRet->bLastBlock = 0 != (nFlags & 0x0004);
- }
- return pRet;
-}
-
-
-SvStream& SvxAdjustItem::Store( SvStream& rStrm, sal_uInt16 nItemVersion ) const
-{
- rStrm.WriteChar( static_cast<char>(GetAdjust()) );
- if ( nItemVersion >= ADJUST_LASTBLOCK_VERSION )
- {
- sal_Int8 nFlags = 0;
- if ( bOneBlock )
- nFlags |= 0x0001;
- if ( bLastCenter )
- nFlags |= 0x0002;
- if ( bLastBlock )
- nFlags |= 0x0004;
- rStrm.WriteSChar( nFlags );
- }
- return rStrm;
-}
-
// class SvxWidowsItem ---------------------------------------------------
SvxWidowsItem::SvxWidowsItem(const sal_uInt8 nL, const sal_uInt16 nId ) :
@@ -752,12 +711,6 @@ sal_uInt16 SvxTabStopItem::GetPos( const sal_Int32 nPos ) const
}
-SvxTabStopItem& SvxTabStopItem::operator=( const SvxTabStopItem& rTSI )
-{
- maTabStops = rTSI.maTabStops;
- return *this;
-}
-
bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
@@ -1090,16 +1043,6 @@ SfxPoolItem* SvxScriptSpaceItem::Clone( SfxItemPool * ) const
return new SvxScriptSpaceItem( *this );
}
-sal_uInt16 SvxScriptSpaceItem::GetVersion( sal_uInt16 nFFVer ) const
-{
- DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer ||
- SOFFICE_FILEFORMAT_40==nFFVer ||
- SOFFICE_FILEFORMAT_50==nFFVer,
- "SvxTwoLinesItem: Is there a new file format? ");
-
- return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0;
-}
-
bool SvxScriptSpaceItem::GetPresentation(
SfxItemPresentation /*ePres*/,
MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
@@ -1123,16 +1066,6 @@ SfxPoolItem* SvxHangingPunctuationItem::Clone( SfxItemPool * ) const
return new SvxHangingPunctuationItem( *this );
}
-sal_uInt16 SvxHangingPunctuationItem::GetVersion( sal_uInt16 nFFVer ) const
-{
- DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer ||
- SOFFICE_FILEFORMAT_40==nFFVer ||
- SOFFICE_FILEFORMAT_50==nFFVer,
- "SvxHangingPunctuationItem: Is there a new file format? ");
-
- return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0;
-}
-
bool SvxHangingPunctuationItem::GetPresentation(
SfxItemPresentation /*ePres*/,
MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
@@ -1156,16 +1089,6 @@ SfxPoolItem* SvxForbiddenRuleItem::Clone( SfxItemPool * ) const
return new SvxForbiddenRuleItem( *this );
}
-sal_uInt16 SvxForbiddenRuleItem::GetVersion( sal_uInt16 nFFVer ) const
-{
- DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer ||
- SOFFICE_FILEFORMAT_40==nFFVer ||
- SOFFICE_FILEFORMAT_50==nFFVer,
- "SvxForbiddenRuleItem: Is there a new file format? ");
-
- return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0;
-}
-
bool SvxForbiddenRuleItem::GetPresentation(
SfxItemPresentation /*ePres*/,
MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
@@ -1192,11 +1115,6 @@ SfxPoolItem* SvxParaVertAlignItem::Clone( SfxItemPool* ) const
return new SvxParaVertAlignItem( *this );
}
-sal_uInt16 SvxParaVertAlignItem::GetVersion( sal_uInt16 nFFVer ) const
-{
- return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0;
-}
-
bool SvxParaVertAlignItem::GetPresentation(
SfxItemPresentation /*ePres*/,
MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
@@ -1252,16 +1170,6 @@ SfxPoolItem* SvxParaGridItem::Clone( SfxItemPool * ) const
return new SvxParaGridItem( *this );
}
-sal_uInt16 SvxParaGridItem::GetVersion( sal_uInt16 nFFVer ) const
-{
- DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer ||
- SOFFICE_FILEFORMAT_40==nFFVer ||
- SOFFICE_FILEFORMAT_50==nFFVer,
- "SvxParaGridItem: Is there a new file format? ");
-
- return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0;
-}
-
bool SvxParaGridItem::GetPresentation(
SfxItemPresentation /*ePres*/,
MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 019fb06eb621..13c5c04ffbbe 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -94,8 +94,6 @@
#include <editeng/eerdll.hxx>
#include <libxml/xmlwriter.h>
-#define STORE_UNICODE_MAGIC_MARKER 0xFE331188
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
@@ -199,17 +197,6 @@ SvxFontItem::SvxFontItem( const FontFamily eFam, const OUString& aName,
}
-SvxFontItem& SvxFontItem::operator=(const SvxFontItem& rFont)
-{
- aFamilyName = rFont.GetFamilyName();
- aStyleName = rFont.GetStyleName();
- eFamily = rFont.GetFamily();
- ePitch = rFont.GetPitch();
- eTextEncoding = rFont.GetCharSet();
- return *this;
-}
-
-
bool SvxFontItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
@@ -330,64 +317,6 @@ SfxPoolItem* SvxFontItem::Clone( SfxItemPool * ) const
}
-SvStream& SvxFontItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
-{
- bool bToBats = IsStarSymbol( GetFamilyName() );
-
- rStrm.WriteUChar( GetFamily() ).WriteUChar( GetPitch() )
- .WriteUChar( bToBats ? RTL_TEXTENCODING_SYMBOL : GetSOStoreTextEncoding(GetCharSet()) );
-
- OUString aStoreFamilyName( GetFamilyName() );
- if( bToBats )
- aStoreFamilyName = "StarBats";
- rStrm.WriteUniOrByteString(aStoreFamilyName, rStrm.GetStreamCharSet());
- rStrm.WriteUniOrByteString(GetStyleName(), rStrm.GetStreamCharSet());
-
- return rStrm;
-}
-
-
-SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const
-{
- sal_uInt8 _eFamily, eFontPitch, eFontTextEncoding;
- OUString aName, aStyle;
- rStrm.ReadUChar( _eFamily );
- rStrm.ReadUChar( eFontPitch );
- rStrm.ReadUChar( eFontTextEncoding );
-
- // UNICODE: rStrm >> aName;
- aName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
-
- // UNICODE: rStrm >> aStyle;
- aStyle = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
-
- // Set the "correct" textencoding
- eFontTextEncoding = static_cast<sal_uInt8>(GetSOLoadTextEncoding( eFontTextEncoding ));
-
- // at some point, the StarBats changes from ANSI font to SYMBOL font
- if ( RTL_TEXTENCODING_SYMBOL != eFontTextEncoding && aName == "StarBats" )
- eFontTextEncoding = RTL_TEXTENCODING_SYMBOL;
-
- // Check if we have stored unicode
- sal_uInt64 const nStreamPos = rStrm.Tell();
- sal_uInt32 nMagic = STORE_UNICODE_MAGIC_MARKER;
- rStrm.ReadUInt32( nMagic );
- if ( nMagic == STORE_UNICODE_MAGIC_MARKER )
- {
- aName = rStrm.ReadUniOrByteString( RTL_TEXTENCODING_UNICODE );
- aStyle = rStrm.ReadUniOrByteString( RTL_TEXTENCODING_UNICODE );
- }
- else
- {
- rStrm.Seek( nStreamPos );
- }
-
-
- return new SvxFontItem( static_cast<FontFamily>(_eFamily), aName, aStyle,
- static_cast<FontPitch>(eFontPitch), static_cast<rtl_TextEncoding>(eFontTextEncoding), Which() );
-}
-
-
bool SvxFontItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -433,21 +362,6 @@ sal_uInt16 SvxPostureItem::GetValueCount() const
}
-SvStream& SvxPostureItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
-{
- rStrm.WriteUChar( GetValue() );
- return rStrm;
-}
-
-
-SfxPoolItem* SvxPostureItem::Create(SvStream& rStrm, sal_uInt16) const
-{
- sal_uInt8 nPosture;
- rStrm.ReadUChar( nPosture );
- return new SvxPostureItem( static_cast<FontItalic>(nPosture), Which() );
-}
-
-
bool SvxPostureItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -581,20 +495,6 @@ SfxPoolItem* SvxWeightItem::Clone( SfxItemPool * ) const
}
-SvStream& SvxWeightItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
-{
- rStrm.WriteUChar( GetValue() );
- return rStrm;
-}
-
-
-SfxPoolItem* SvxWeightItem::Create(SvStream& rStrm, sal_uInt16) const
-{
- sal_uInt8 nWeight;
- rStrm.ReadUChar( nWeight );
- return new SvxWeightItem( static_cast<FontWeight>(nWeight), Which() );
-}
-
bool SvxWeightItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -697,55 +597,6 @@ SfxPoolItem* SvxFontHeightItem::Clone( SfxItemPool * ) const
}
-SvStream& SvxFontHeightItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const
-{
- rStrm.WriteUInt16( GetHeight() );
-
- if( FONTHEIGHT_UNIT_VERSION <= nItemVersion )
- rStrm.WriteUInt16( GetProp() ).WriteUInt16( static_cast<sal_uInt16>(GetPropUnit()) );
- else
- {
- // When exporting to the old versions the relative information is lost
- // when there is no percentage
- sal_uInt16 _nProp = GetProp();
- if( MapUnit::MapRelative != GetPropUnit() )
- _nProp = 100;
- rStrm.WriteUInt16( _nProp );
- }
- return rStrm;
-}
-
-
-SfxPoolItem* SvxFontHeightItem::Create( SvStream& rStrm,
- sal_uInt16 nVersion ) const
-{
- sal_uInt16 nsize, nprop = 0;
- MapUnit nPropUnit = MapUnit::MapRelative;
-
- rStrm.ReadUInt16( nsize );
-
- if( FONTHEIGHT_16_VERSION <= nVersion )
- rStrm.ReadUInt16( nprop );
- else
- {
- sal_uInt8 nP;
- rStrm .ReadUChar( nP );
- nprop = static_cast<sal_uInt16>(nP);
- }
-
- if( FONTHEIGHT_UNIT_VERSION <= nVersion )
- {
- sal_uInt16 nTmp;
- rStrm.ReadUInt16( nTmp );
- nPropUnit = static_cast<MapUnit>(nTmp);
- }
-
- SvxFontHeightItem* pItem = new SvxFontHeightItem( nsize, 100, Which() );
- pItem->SetProp( nprop, nPropUnit );
- return pItem;
-}
-
-
bool SvxFontHeightItem::operator==( const SfxPoolItem& rItem ) const
{
assert(SfxPoolItem::operator==(rItem));
@@ -1009,14 +860,6 @@ bool SvxFontHeightItem::GetPresentation
}
-sal_uInt16 SvxFontHeightItem::GetVersion(sal_uInt16 nFileVersion) const
-{
- return (nFileVersion <= SOFFICE_FILEFORMAT_40)
- ? FONTHEIGHT_16_VERSION
- : FONTHEIGHT_UNIT_VERSION;
-}
-
-
void SvxFontHeightItem::ScaleMetrics( long nMult, long nDiv )
{
nHeight = static_cast<sal_uInt32>(Scale( nHeight, nMult, nDiv ));
@@ -1112,21 +955,6 @@ sal_uInt16 SvxTextLineItem::GetValueCount() const
}
-SvStream& SvxTextLineItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
-{
- rStrm.WriteUChar( GetValue() );
- return rStrm;
-}
-
-
-SfxPoolItem* SvxTextLineItem::Create(SvStream& rStrm, sal_uInt16) const
-{
- sal_uInt8 nState;
- rStrm.ReadUChar( nState );
- return new SvxTextLineItem( static_cast<FontLineStyle>(nState), Which() );
-}
-
-
bool SvxTextLineItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -1232,14 +1060,6 @@ SfxPoolItem* SvxUnderlineItem::Clone( SfxItemPool * ) const
}
-SfxPoolItem* SvxUnderlineItem::Create(SvStream& rStrm, sal_uInt16) const
-{
- sal_uInt8 nState;
- rStrm.ReadUChar( nState );
- return new SvxUnderlineItem( static_cast<FontLineStyle>(nState), Which() );
-}
-
-
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list