diff options
author | Armin Le Grand <Armin.Le.Grand@me.com> | 2019-04-18 19:25:06 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2019-04-25 19:59:04 +0200 |
commit | 1e2682235cded9a7cd90e55f0bfc60a1285e9a46 (patch) | |
tree | 17457bc49d6faf37270c8a481b94765f58a5f434 /sc/inc | |
parent | 5e4c1e6ba425ce0b75864e4584a846957b032e61 (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 'sc/inc')
-rw-r--r-- | sc/inc/attrib.hxx | 1 | ||||
-rw-r--r-- | sc/inc/autoform.hxx | 141 |
2 files changed, 12 insertions, 130 deletions
diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index cecc587c8df3..37340e786fe2 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -207,7 +207,6 @@ public: virtual sal_uInt16 GetValueCount() const override; virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; - virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const override; virtual bool GetPresentation( SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, diff --git a/sc/inc/autoform.hxx b/sc/inc/autoform.hxx index 8982cbd17400..b9279eef5965 100644 --- a/sc/inc/autoform.hxx +++ b/sc/inc/autoform.hxx @@ -46,6 +46,7 @@ #include <editeng/wghtitem.hxx> #include <editeng/justifyitem.hxx> #include <svx/rotmodit.hxx> +#include <svx/autoformathelper.hxx> #include <svl/intitem.hxx> #include <editeng/lineitem.hxx> #include "scdllapi.h" @@ -86,155 +87,37 @@ struct AutoFormatSwBlob }; /// Struct with version numbers of the Items -struct ScAfVersions +struct ScAfVersions : public AutoFormatVersions { public: - sal_uInt16 nFontVersion; - sal_uInt16 nFontHeightVersion; - sal_uInt16 nWeightVersion; - sal_uInt16 nPostureVersion; - sal_uInt16 nUnderlineVersion; - sal_uInt16 nOverlineVersion; - sal_uInt16 nCrossedOutVersion; - sal_uInt16 nContourVersion; - sal_uInt16 nShadowedVersion; - sal_uInt16 nColorVersion; - sal_uInt16 nBoxVersion; - sal_uInt16 nLineVersion; - sal_uInt16 nBrushVersion; - - sal_uInt16 nAdjustVersion; AutoFormatSwBlob swVersions; - sal_uInt16 nHorJustifyVersion; - sal_uInt16 nVerJustifyVersion; - sal_uInt16 nOrientationVersion; - sal_uInt16 nMarginVersion; - sal_uInt16 nBoolVersion; - sal_uInt16 nInt32Version; - sal_uInt16 nRotateModeVersion; - - sal_uInt16 nNumFmtVersion; - ScAfVersions(); + void Load( SvStream& rStream, sal_uInt16 nVer ); void Write(SvStream& rStream, sal_uInt16 fileVersion); }; /// Contains all items for one cell of a table autoformat. -class ScAutoFormatDataField +class ScAutoFormatDataField : public AutoFormatBase { private: - SvxFontItem aFont; - SvxFontHeightItem aHeight; - SvxWeightItem aWeight; - SvxPostureItem aPosture; - - SvxFontItem aCJKFont; - SvxFontHeightItem aCJKHeight; - SvxWeightItem aCJKWeight; - SvxPostureItem aCJKPosture; - - SvxFontItem aCTLFont; - SvxFontHeightItem aCTLHeight; - SvxWeightItem aCTLWeight; - SvxPostureItem aCTLPosture; - - SvxUnderlineItem aUnderline; - SvxOverlineItem aOverline; - SvxCrossedOutItem aCrossedOut; - SvxContourItem aContour; - SvxShadowedItem aShadowed; - SvxColorItem aColor; - SvxBoxItem aBox; - SvxLineItem aTLBR; - SvxLineItem aBLTR; - SvxBrushItem aBackground; - - // Writer specific - SvxAdjustItem aAdjust; - AutoFormatSwBlob m_swFields; - - // Calc specific - SvxHorJustifyItem aHorJustify; - SvxVerJustifyItem aVerJustify; - SfxBoolItem aStacked; - SvxMarginItem aMargin; - SfxBoolItem aLinebreak; - // from SO5, 504k on, rotated text - SfxInt32Item aRotateAngle; - SvxRotateModeItem aRotateMode; + AutoFormatSwBlob m_swFields; // number format - ScNumFormatAbbrev aNumFormat; + ScNumFormatAbbrev aNumFormat; public: - ScAutoFormatDataField(); - ScAutoFormatDataField( const ScAutoFormatDataField& rCopy ); - ~ScAutoFormatDataField(); + ScAutoFormatDataField(); + ScAutoFormatDataField( const ScAutoFormatDataField& rCopy ); + ~ScAutoFormatDataField(); + const AutoFormatSwBlob& GetAutoFormatSwBlob() const { return m_swFields; } + // number format const ScNumFormatAbbrev& GetNumFormat() const { return aNumFormat; } - const SvxFontItem& GetFont() const { return aFont; } - const SvxFontHeightItem& GetHeight() const { return aHeight; } - const SvxWeightItem& GetWeight() const { return aWeight; } - const SvxPostureItem& GetPosture() const { return aPosture; } - const SvxFontItem& GetCJKFont() const { return aCJKFont; } - const SvxFontHeightItem& GetCJKHeight() const { return aCJKHeight; } - const SvxWeightItem& GetCJKWeight() const { return aCJKWeight; } - const SvxPostureItem& GetCJKPosture() const { return aCJKPosture; } - const SvxFontItem& GetCTLFont() const { return aCTLFont; } - const SvxFontHeightItem& GetCTLHeight() const { return aCTLHeight; } - const SvxWeightItem& GetCTLWeight() const { return aCTLWeight; } - const SvxPostureItem& GetCTLPosture() const { return aCTLPosture; } - const SvxUnderlineItem& GetUnderline() const { return aUnderline; } - const SvxOverlineItem& GetOverline() const { return aOverline; } - const SvxCrossedOutItem& GetCrossedOut() const { return aCrossedOut; } - const SvxContourItem& GetContour() const { return aContour; } - const SvxShadowedItem& GetShadowed() const { return aShadowed; } - const SvxColorItem& GetColor() const { return aColor; } - const SvxHorJustifyItem& GetHorJustify() const { return aHorJustify; } - const SvxVerJustifyItem& GetVerJustify() const { return aVerJustify; } - const SfxBoolItem& GetStacked() const { return aStacked; } - const SfxBoolItem& GetLinebreak() const { return aLinebreak; } - const SvxMarginItem& GetMargin() const { return aMargin; } - const SvxBoxItem& GetBox() const { return aBox; } - const SvxLineItem& GetTLBR() const { return aTLBR; } - const SvxLineItem& GetBLTR() const { return aBLTR; } - const SvxBrushItem& GetBackground() const { return aBackground; } - const SfxInt32Item& GetRotateAngle() const { return aRotateAngle; } - const SvxRotateModeItem& GetRotateMode() const { return aRotateMode; } + // number format void SetNumFormat( const ScNumFormatAbbrev& rNumFormat ) { aNumFormat = rNumFormat; } - void SetFont( const SvxFontItem& rFont ) { aFont = rFont; } - void SetHeight( const SvxFontHeightItem& rHeight ) { aHeight = rHeight; } - void SetWeight( const SvxWeightItem& rWeight ) { aWeight = rWeight; } - void SetPosture( const SvxPostureItem& rPosture ) { aPosture = rPosture; } - void SetCJKFont( const SvxFontItem& rCJKFont ) { aCJKFont = rCJKFont; } - void SetCJKHeight( const SvxFontHeightItem& rCJKHeight ) { aCJKHeight = rCJKHeight; } - void SetCJKWeight( const SvxWeightItem& rCJKWeight ) { aCJKWeight = rCJKWeight; } - void SetCJKPosture( const SvxPostureItem& rCJKPosture ) { aCJKPosture = rCJKPosture; } - void SetCTLFont( const SvxFontItem& rCTLFont ) { aCTLFont = rCTLFont; } - void SetCTLHeight( const SvxFontHeightItem& rCTLHeight ) { aCTLHeight = rCTLHeight; } - void SetCTLWeight( const SvxWeightItem& rCTLWeight ) { aCTLWeight = rCTLWeight; } - void SetCTLPosture( const SvxPostureItem& rCTLPosture ) { aCTLPosture = rCTLPosture; } - void SetUnderline( const SvxUnderlineItem& rUnderline ) { aUnderline = rUnderline; } - void SetOverline( const SvxOverlineItem& rOverline ) { aOverline = rOverline; } - void SetCrossedOut( const SvxCrossedOutItem& rCrossedOut ) { aCrossedOut = rCrossedOut; } - void SetContour( const SvxContourItem& rContour ) { aContour = rContour; } - void SetShadowed( const SvxShadowedItem& rShadowed ) { aShadowed = rShadowed; } - void SetColor( const SvxColorItem& rColor ) { aColor = rColor; } - void SetHorJustify( const SvxHorJustifyItem& rHorJustify ) { aHorJustify = rHorJustify; } - void SetVerJustify( const SvxVerJustifyItem& rVerJustify ) { aVerJustify = rVerJustify; } - void SetStacked( const SfxBoolItem& rStacked ) { aStacked.SetValue( rStacked.GetValue() ); } - void SetLinebreak( const SfxBoolItem& rLinebreak ) { aLinebreak.SetValue( rLinebreak.GetValue() ); } - void SetMargin( const SvxMarginItem& rMargin ) { aMargin = rMargin; } - void SetBox( const SvxBoxItem& rBox ) { aBox = rBox; } - void SetTLBR( const SvxLineItem& rTLBR ) { aTLBR = rTLBR; } - void SetBLTR( const SvxLineItem& rBLTR ) { aBLTR = rBLTR; } - void SetBackground( const SvxBrushItem& rBackground ) { aBackground = rBackground; } - void SetAdjust( const SvxAdjustItem& rAdjust ); - void SetRotateAngle( const SfxInt32Item& rRotateAngle ) { aRotateAngle.SetValue( rRotateAngle.GetValue() ); } - void SetRotateMode( const SvxRotateModeItem& rRotateMode ) { aRotateMode.SetValue( rRotateMode.GetValue() ); } bool Load( SvStream& rStream, const ScAfVersions& rVersions, sal_uInt16 nVer ); bool Save( SvStream& rStream, sal_uInt16 fileVersion ); |