summaryrefslogtreecommitdiff
path: root/editeng/source/items/frmitems.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'editeng/source/items/frmitems.cxx')
-rw-r--r--editeng/source/items/frmitems.cxx190
1 files changed, 59 insertions, 131 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index e84ce92afa4a..46c74854f246 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -4,7 +4,7 @@
*
* 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/.
+ * file, You can obtain one at http: // mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
@@ -14,7 +14,7 @@
* 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 .
+ * the License at http: // www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/uno/Any.hxx>
@@ -89,6 +89,7 @@ using namespace ::com::sun::star;
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
@@ -115,6 +116,7 @@ namespace
return stream;
}
+
/// Creates a border line from a stream.
SvxBorderLine CreateBorderLine(SvStream &stream, sal_uInt16 version)
{
@@ -131,6 +133,7 @@ namespace
return border;
}
+
/// Retrieves a BORDER_LINE_* version from a BOX_BORDER_* version.
sal_uInt16 BorderLineVersionFromBoxVersion(sal_uInt16 boxVersion)
{
@@ -156,15 +159,12 @@ SfxPoolItem* SvxLineItem::CreateDefault() { return new SvxLineItem(0);}
SfxPoolItem* SvxFrameDirectionItem::CreateDefault() { return new SvxFrameDirectionItem(FRMDIR_HORI_LEFT_TOP, 0);}
-// class SvxPaperBinItem ------------------------------------------------
-
SfxPoolItem* SvxPaperBinItem::Clone( SfxItemPool* ) const
{
return new SvxPaperBinItem( *this );
}
-
SvStream& SvxPaperBinItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
{
rStrm.WriteUChar( GetValue() );
@@ -172,7 +172,6 @@ SvStream& SvxPaperBinItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/
}
-
SfxPoolItem* SvxPaperBinItem::Create( SvStream& rStrm, sal_uInt16 ) const
{
sal_Int8 nBin;
@@ -181,7 +180,6 @@ SfxPoolItem* SvxPaperBinItem::Create( SvStream& rStrm, sal_uInt16 ) const
}
-
bool SvxPaperBinItem::GetPresentation
(
SfxItemPresentation ePres,
@@ -209,13 +207,12 @@ bool SvxPaperBinItem::GetPresentation
return true;
}
//no break necessary
- default: ;//prevent warning
+ default: ; //prevent warning
}
return false;
}
-// class SvxSizeItem -----------------------------------------------------
SvxSizeItem::SvxSizeItem( const sal_uInt16 nId, const Size& rSize ) :
@@ -249,6 +246,7 @@ bool SvxSizeItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
return true;
}
+
bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
@@ -299,7 +297,6 @@ bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
-
SvxSizeItem::SvxSizeItem( const sal_uInt16 nId ) :
SfxPoolItem( nId )
@@ -307,7 +304,6 @@ SvxSizeItem::SvxSizeItem( const sal_uInt16 nId ) :
}
-
bool SvxSizeItem::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
@@ -316,14 +312,12 @@ bool SvxSizeItem::operator==( const SfxPoolItem& rAttr ) const
}
-
SfxPoolItem* SvxSizeItem::Clone( SfxItemPool* ) const
{
return new SvxSizeItem( *this );
}
-
bool SvxSizeItem::GetPresentation
(
SfxItemPresentation ePres,
@@ -350,15 +344,14 @@ bool SvxSizeItem::GetPresentation
GetMetricText( aSize.Height(), eCoreUnit, ePresUnit, pIntl ) +
" " + EE_RESSTR(GetMetricId(ePresUnit));
return true;
- //no break necessary
- default: ;//prevent warning
+ // no break necessary
+ default: ; // prevent warning
}
return false;
}
-
SvStream& SvxSizeItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
{
rStrm.WriteInt32( aSize.Width() );
@@ -367,7 +360,6 @@ SvStream& SvxSizeItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) co
}
-
void SvxSizeItem::ScaleMetrics( long nMult, long nDiv )
{
aSize.Width() = Scale( aSize.Width(), nMult, nDiv );
@@ -375,14 +367,12 @@ void SvxSizeItem::ScaleMetrics( long nMult, long nDiv )
}
-
bool SvxSizeItem::HasMetrics() const
{
return true;
}
-
SfxPoolItem* SvxSizeItem::Create( SvStream& rStrm, sal_uInt16 ) const
{
sal_Int32 nWidth(0), nHeight(0);
@@ -394,7 +384,6 @@ SfxPoolItem* SvxSizeItem::Create( SvStream& rStrm, sal_uInt16 ) const
return pAttr;
}
-// class SvxLRSpaceItem --------------------------------------------------
SvxLRSpaceItem::SvxLRSpaceItem( const sal_uInt16 nId ) :
@@ -414,12 +403,10 @@ SvxLRSpaceItem::SvxLRSpaceItem( const sal_uInt16 nId ) :
}
-
SvxLRSpaceItem::SvxLRSpaceItem( const long nLeft, const long nRight,
const long nTLeft, const short nOfset,
- const sal_uInt16 nId ) :
-
- SfxPoolItem( nId ),
+ const sal_uInt16 nId )
+: SfxPoolItem( nId ),
nTxtLeft ( nTLeft ),
nLeftMargin ( nLeft ),
@@ -538,9 +525,7 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
-
-// Adapt nLeftMargin and nTxtLeft.
-
+/// Adapt nLeftMargin and nTxtLeft.
void SvxLRSpaceItem::AdjustLeft()
{
if ( 0 > nFirstLineOfst )
@@ -550,7 +535,6 @@ void SvxLRSpaceItem::AdjustLeft()
}
-
bool SvxLRSpaceItem::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
@@ -571,14 +555,12 @@ bool SvxLRSpaceItem::operator==( const SfxPoolItem& rAttr ) const
}
-
SfxPoolItem* SvxLRSpaceItem::Clone( SfxItemPool* ) const
{
return new SvxLRSpaceItem( *this );
}
-
bool SvxLRSpaceItem::GetPresentation
(
SfxItemPresentation ePres,
@@ -660,17 +642,18 @@ bool SvxLRSpaceItem::GetPresentation
}
return true;
}
- default: ;//prevent warning
+ default: ; // prevent warning
}
return false;
}
-
-// BulletFI: Before 501 in the Outliner the bullet was not on the position of
-// the FI, so in older documents one must set FI to 0.
+/** @attention BulletFI: Before v501 in the Outliner the bullet was not on the position of
+ the FI, so in older documents one must set FI to 0.
+ */
#define BULLETLR_MARKER 0x599401FE
+
SvStream& SvxLRSpaceItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const
{
short nSaveFI = nFirstLineOfst;
@@ -720,7 +703,6 @@ SvStream& SvxLRSpaceItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) con
}
-
SfxPoolItem* SvxLRSpaceItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) const
{
sal_uInt16 left, prpleft, right, prpright, prpfirstline, txtleft;
@@ -784,7 +766,6 @@ SfxPoolItem* SvxLRSpaceItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) cons
}
-
sal_uInt16 SvxLRSpaceItem::GetVersion( sal_uInt16 nFileVersion ) const
{
return (nFileVersion == SOFFICE_FILEFORMAT_31)
@@ -793,7 +774,6 @@ sal_uInt16 SvxLRSpaceItem::GetVersion( sal_uInt16 nFileVersion ) const
}
-
void SvxLRSpaceItem::ScaleMetrics( long nMult, long nDiv )
{
nFirstLineOfst = (short)Scale( nFirstLineOfst, nMult, nDiv );
@@ -803,12 +783,12 @@ void SvxLRSpaceItem::ScaleMetrics( long nMult, long nDiv )
}
-
bool SvxLRSpaceItem::HasMetrics() const
{
return true;
}
+
void SvxLRSpaceItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("svxLRSpaceItem"));
@@ -826,7 +806,6 @@ void SvxLRSpaceItem::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterEndElement(pWriter);
}
-// class SvxULSpaceItem --------------------------------------------------
SvxULSpaceItem::SvxULSpaceItem( const sal_uInt16 nId )
: SfxPoolItem(nId)
@@ -839,7 +818,6 @@ SvxULSpaceItem::SvxULSpaceItem( const sal_uInt16 nId )
}
-
SvxULSpaceItem::SvxULSpaceItem( const sal_uInt16 nUp, const sal_uInt16 nLow,
const sal_uInt16 nId )
: SfxPoolItem(nId)
@@ -852,7 +830,7 @@ SvxULSpaceItem::SvxULSpaceItem( const sal_uInt16 nUp, const sal_uInt16 nLow,
}
-bool SvxULSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SvxULSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
@@ -941,7 +919,6 @@ bool SvxULSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
-
bool SvxULSpaceItem::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
@@ -955,14 +932,12 @@ bool SvxULSpaceItem::operator==( const SfxPoolItem& rAttr ) const
}
-
SfxPoolItem* SvxULSpaceItem::Clone( SfxItemPool* ) const
{
return new SvxULSpaceItem( *this );
}
-
bool SvxULSpaceItem::GetPresentation
(
SfxItemPresentation ePres,
@@ -1021,13 +996,12 @@ bool SvxULSpaceItem::GetPresentation
}
return true;
}
- default: ;//prevent warning
+ default: ; // prevent warning
}
return false;
}
-
SvStream& SvxULSpaceItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
{
rStrm.WriteUInt16( GetUpper() )
@@ -1038,7 +1012,6 @@ SvStream& SvxULSpaceItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ )
}
-
SfxPoolItem* SvxULSpaceItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) const
{
sal_uInt16 upper, lower, nPL = 0, nPU = 0;
@@ -1062,14 +1035,12 @@ SfxPoolItem* SvxULSpaceItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) cons
}
-
sal_uInt16 SvxULSpaceItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
{
return ULSPACE_16_VERSION;
}
-
void SvxULSpaceItem::ScaleMetrics( long nMult, long nDiv )
{
nUpper = (sal_uInt16)Scale( nUpper, nMult, nDiv );
@@ -1077,12 +1048,12 @@ void SvxULSpaceItem::ScaleMetrics( long nMult, long nDiv )
}
-
bool SvxULSpaceItem::HasMetrics() const
{
return true;
}
+
void SvxULSpaceItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("svxULSpaceItem"));
@@ -1095,7 +1066,6 @@ void SvxULSpaceItem::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterEndElement(pWriter);
}
-// class SvxPrintItem ----------------------------------------------------
SfxPoolItem* SvxPrintItem::Clone( SfxItemPool* ) const
{
@@ -1103,7 +1073,6 @@ SfxPoolItem* SvxPrintItem::Clone( SfxItemPool* ) const
}
-
SvStream& SvxPrintItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
{
rStrm.WriteSChar( (sal_Int8)GetValue() );
@@ -1111,7 +1080,6 @@ SvStream& SvxPrintItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) c
}
-
SfxPoolItem* SvxPrintItem::Create( SvStream& rStrm, sal_uInt16 ) const
{
sal_Int8 bIsPrint;
@@ -1120,7 +1088,6 @@ SfxPoolItem* SvxPrintItem::Create( SvStream& rStrm, sal_uInt16 ) const
}
-
bool SvxPrintItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -1137,7 +1104,6 @@ bool SvxPrintItem::GetPresentation
return true;
}
-// class SvxOpaqueItem ---------------------------------------------------
SfxPoolItem* SvxOpaqueItem::Clone( SfxItemPool* ) const
{
@@ -1145,7 +1111,6 @@ SfxPoolItem* SvxOpaqueItem::Clone( SfxItemPool* ) const
}
-
SvStream& SvxOpaqueItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
{
rStrm.WriteSChar( (sal_Int8)GetValue() );
@@ -1153,7 +1118,6 @@ SvStream& SvxOpaqueItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ )
}
-
SfxPoolItem* SvxOpaqueItem::Create( SvStream& rStrm, sal_uInt16 ) const
{
sal_Int8 bIsOpaque;
@@ -1162,7 +1126,6 @@ SfxPoolItem* SvxOpaqueItem::Create( SvStream& rStrm, sal_uInt16 ) const
}
-
bool SvxOpaqueItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -1179,7 +1142,6 @@ bool SvxOpaqueItem::GetPresentation
return true;
}
-// class SvxProtectItem --------------------------------------------------
bool SvxProtectItem::operator==( const SfxPoolItem& rAttr ) const
{
@@ -1191,6 +1153,7 @@ bool SvxProtectItem::operator==( const SfxPoolItem& rAttr ) const
bPos == rItem.bPos );
}
+
bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
@@ -1209,7 +1172,8 @@ bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
return true;
}
-bool SvxProtectItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+
+bool SvxProtectItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
nMemberId &= ~CONVERT_TWIPS;
bool bVal( Any2Bool(rVal) );
@@ -1226,14 +1190,12 @@ bool SvxProtectItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
-
SfxPoolItem* SvxProtectItem::Clone( SfxItemPool* ) const
{
return new SvxProtectItem( *this );
}
-
bool SvxProtectItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -1261,7 +1223,6 @@ bool SvxProtectItem::GetPresentation
}
-
SvStream& SvxProtectItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
{
sal_Int8 cProt = 0;
@@ -1273,7 +1234,6 @@ SvStream& SvxProtectItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ )
}
-
SfxPoolItem* SvxProtectItem::Create( SvStream& rStrm, sal_uInt16 ) const
{
sal_Int8 cFlags;
@@ -1285,6 +1245,7 @@ SfxPoolItem* SvxProtectItem::Create( SvStream& rStrm, sal_uInt16 ) const
return pAttr;
}
+
void SvxProtectItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("svxProtectItem"));
@@ -1295,7 +1256,6 @@ void SvxProtectItem::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterEndElement(pWriter);
}
-// class SvxShadowItem ---------------------------------------------------
SvxShadowItem::SvxShadowItem( const sal_uInt16 nId,
const Color *pColor, const sal_uInt16 nW,
@@ -1323,7 +1283,7 @@ bool SvxShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case SVX_SHADOW_TOPRIGHT : eSet = table::ShadowLocation_TOP_RIGHT ; break;
case SVX_SHADOW_BOTTOMLEFT : eSet = table::ShadowLocation_BOTTOM_LEFT ; break;
case SVX_SHADOW_BOTTOMRIGHT: eSet = table::ShadowLocation_BOTTOM_RIGHT; break;
- default: ;//prevent warning
+ default: ; // prevent warning
}
aShadow.Location = eSet;
aShadow.ShadowWidth = bConvert ? convertTwipToMm100(nWidth) : nWidth;
@@ -1396,7 +1356,7 @@ bool SvxShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
case table::ShadowLocation_TOP_RIGHT : eLocation = SVX_SHADOW_TOPRIGHT; break;
case table::ShadowLocation_BOTTOM_LEFT : eLocation = SVX_SHADOW_BOTTOMLEFT ; break;
case table::ShadowLocation_BOTTOM_RIGHT: eLocation = SVX_SHADOW_BOTTOMRIGHT; break;
- default: ;//prevent warning
+ default: ; // prevent warning
}
nWidth = bConvert ? convertMm100ToTwip(aShadow.ShadowWidth) : aShadow.ShadowWidth;
@@ -1509,7 +1469,7 @@ bool SvxShadowItem::GetPresentation
EE_RESSTR(RID_SVXITEMS_SHADOW_BEGIN + eLocation);
return true;
}
- default: ;//prevent warning
+ default: ; // prevent warning
}
return false;
}
@@ -2215,7 +2175,7 @@ bool SvxBoxItem::GetPresentation
}
return true;
}
- default: ;//prevent warning
+ default: ; // prevent warning
}
return false;
}
@@ -2975,7 +2935,7 @@ bool SvxFormatBreakItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) c
case SVX_BREAK_PAGE_BEFORE: eBreak = style::BreakType_PAGE_BEFORE ; break;
case SVX_BREAK_PAGE_AFTER: eBreak = style::BreakType_PAGE_AFTER ; break;
case SVX_BREAK_PAGE_BOTH: eBreak = style::BreakType_PAGE_BOTH ; break;
- default: ;//prevent warning
+ default: ; // prevent warning
}
rVal <<= eBreak;
return true;
@@ -3003,7 +2963,7 @@ bool SvxFormatBreakItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/
case style::BreakType_PAGE_BEFORE: eBreak = SVX_BREAK_PAGE_BEFORE; break;
case style::BreakType_PAGE_AFTER: eBreak = SVX_BREAK_PAGE_AFTER; break;
case style::BreakType_PAGE_BOTH: eBreak = SVX_BREAK_PAGE_BOTH; break;
- default: ;//prevent warning
+ default: ; // prevent warning
}
SetValue((sal_uInt16) eBreak);
@@ -3011,14 +2971,12 @@ bool SvxFormatBreakItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/
}
-
SfxPoolItem* SvxFormatBreakItem::Clone( SfxItemPool* ) const
{
return new SvxFormatBreakItem( *this );
}
-
SvStream& SvxFormatBreakItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const
{
rStrm.WriteSChar( GetValue() );
@@ -3028,7 +2986,6 @@ SvStream& SvxFormatBreakItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion )
}
-
sal_uInt16 SvxFormatBreakItem::GetVersion( sal_uInt16 nFFVer ) const
{
DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer ||
@@ -3040,7 +2997,6 @@ sal_uInt16 SvxFormatBreakItem::GetVersion( sal_uInt16 nFFVer ) const
}
-
SfxPoolItem* SvxFormatBreakItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) const
{
sal_Int8 eBreak, bDummy;
@@ -3051,13 +3007,11 @@ SfxPoolItem* SvxFormatBreakItem::Create( SvStream& rStrm, sal_uInt16 nVersion )
}
-
sal_uInt16 SvxFormatBreakItem::GetValueCount() const
{
return SVX_BREAK_END; // SVX_BREAK_PAGE_BOTH + 1
}
-// class SvxFormatKeepItem -------------------------------------------------
SfxPoolItem* SvxFormatKeepItem::Clone( SfxItemPool* ) const
{
@@ -3065,7 +3019,6 @@ SfxPoolItem* SvxFormatKeepItem::Clone( SfxItemPool* ) const
}
-
SvStream& SvxFormatKeepItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
{
rStrm.WriteSChar( (sal_Int8)GetValue() );
@@ -3073,7 +3026,6 @@ SvStream& SvxFormatKeepItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*
}
-
SfxPoolItem* SvxFormatKeepItem::Create( SvStream& rStrm, sal_uInt16 ) const
{
sal_Int8 bIsKeep;
@@ -3082,7 +3034,6 @@ SfxPoolItem* SvxFormatKeepItem::Create( SvStream& rStrm, sal_uInt16 ) const
}
-
bool SvxFormatKeepItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -3099,7 +3050,6 @@ bool SvxFormatKeepItem::GetPresentation
return true;
}
-// class SvxLineItem ------------------------------------------------------
SvxLineItem::SvxLineItem( const sal_uInt16 nId ) :
@@ -3110,7 +3060,6 @@ SvxLineItem::SvxLineItem( const sal_uInt16 nId ) :
}
-
SvxLineItem::SvxLineItem( const SvxLineItem& rCpy ) :
SfxPoolItem ( rCpy )
@@ -3119,14 +3068,12 @@ SvxLineItem::SvxLineItem( const SvxLineItem& rCpy ) :
}
-
SvxLineItem::~SvxLineItem()
{
delete pLine;
}
-
SvxLineItem& SvxLineItem::operator=( const SvxLineItem& rLine )
{
SetLine( rLine.GetLine() );
@@ -3135,7 +3082,6 @@ SvxLineItem& SvxLineItem::operator=( const SvxLineItem& rLine )
}
-
bool SvxLineItem::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
@@ -3144,12 +3090,12 @@ bool SvxLineItem::operator==( const SfxPoolItem& rAttr ) const
}
-
SfxPoolItem* SvxLineItem::Clone( SfxItemPool* ) const
{
return new SvxLineItem( *this );
}
+
bool SvxLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemId ) const
{
bool bConvert = 0!=(nMemId&CONVERT_TWIPS);
@@ -3177,7 +3123,6 @@ bool SvxLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemId ) const
}
-
bool SvxLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemId )
{
bool bConvert = 0!=(nMemId&CONVERT_TWIPS);
@@ -3219,7 +3164,6 @@ bool SvxLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemId )
}
-
bool SvxLineItem::GetPresentation
(
SfxItemPresentation ePres,
@@ -3237,7 +3181,6 @@ bool SvxLineItem::GetPresentation
}
-
SvStream& SvxLineItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
{
if( pLine )
@@ -3256,21 +3199,18 @@ SvStream& SvxLineItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) co
}
-
void SvxLineItem::ScaleMetrics( long nMult, long nDiv )
{
if ( pLine ) pLine->ScaleMetrics( nMult, nDiv );
}
-
bool SvxLineItem::HasMetrics() const
{
return true;
}
-
SfxPoolItem* SvxLineItem::Create( SvStream& rStrm, sal_uInt16 ) const
{
SvxLineItem* _pLine = new SvxLineItem( Which() );
@@ -3288,20 +3228,17 @@ SfxPoolItem* SvxLineItem::Create( SvStream& rStrm, sal_uInt16 ) const
}
-
void SvxLineItem::SetLine( const SvxBorderLine* pNew )
{
delete pLine;
pLine = pNew ? new SvxBorderLine( *pNew ) : nullptr;
}
-// class SvxBrushItem ----------------------------------------------------
#define LOAD_GRAPHIC ((sal_uInt16)0x0001)
#define LOAD_LINK ((sal_uInt16)0x0002)
#define LOAD_FILTER ((sal_uInt16)0x0004)
-// class SvxBrushItem_Impl -----------------------------------------------
class SvxBrushItem_Impl
{
@@ -3315,7 +3252,6 @@ public:
};
-
SvxBrushItem::SvxBrushItem( sal_uInt16 _nWhich ) :
SfxPoolItem( _nWhich ),
@@ -3332,7 +3268,6 @@ SvxBrushItem::SvxBrushItem( sal_uInt16 _nWhich ) :
}
-
SvxBrushItem::SvxBrushItem( const Color& rColor, sal_uInt16 _nWhich) :
SfxPoolItem( _nWhich ),
@@ -3349,7 +3284,6 @@ SvxBrushItem::SvxBrushItem( const Color& rColor, sal_uInt16 _nWhich) :
}
-
SvxBrushItem::SvxBrushItem( const Graphic& rGraphic, SvxGraphicPosition ePos,
sal_uInt16 _nWhich ) :
@@ -3368,7 +3302,6 @@ SvxBrushItem::SvxBrushItem( const Graphic& rGraphic, SvxGraphicPosition ePos,
}
-
SvxBrushItem::SvxBrushItem( const GraphicObject& rGraphicObj,
SvxGraphicPosition ePos, sal_uInt16 _nWhich ) :
@@ -3387,7 +3320,6 @@ SvxBrushItem::SvxBrushItem( const GraphicObject& rGraphicObj,
}
-
SvxBrushItem::SvxBrushItem(
const OUString& rLink, const OUString& rFilter,
SvxGraphicPosition ePos, sal_uInt16 _nWhich ) :
@@ -3407,7 +3339,6 @@ SvxBrushItem::SvxBrushItem(
}
-
SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
sal_uInt16 _nWhich )
: SfxPoolItem( _nWhich )
@@ -3431,7 +3362,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
switch ( nStyle )
{
- case 8://BRUSH_25:
+ case 8: // BRUSH_25:
{
sal_uInt32 nRed = aTempColor.GetRed();
sal_uInt32 nGreen = aTempColor.GetGreen();
@@ -3443,7 +3374,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
}
break;
- case 9://BRUSH_50:
+ case 9: // BRUSH_50:
{
sal_uInt32 nRed = aTempColor.GetRed();
sal_uInt32 nGreen = aTempColor.GetGreen();
@@ -3455,7 +3386,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
}
break;
- case 10://BRUSH_75:
+ case 10: // BRUSH_75:
{
sal_uInt32 nRed = aTempColor.GetRed()*2;
sal_uInt32 nGreen = aTempColor.GetGreen()*2;
@@ -3467,7 +3398,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
}
break;
- case 0://BRUSH_NULL:
+ case 0: // BRUSH_NULL:
aColor = Color( COL_TRANSPARENT );
break;
@@ -3522,7 +3453,6 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
}
-
SvxBrushItem::SvxBrushItem( const SvxBrushItem& rItem ) :
SfxPoolItem( rItem.Which() ),
@@ -3538,14 +3468,12 @@ SvxBrushItem::SvxBrushItem( const SvxBrushItem& rItem ) :
}
-
SvxBrushItem::~SvxBrushItem()
{
delete pImpl->pGraphicObject;
}
-
sal_uInt16 SvxBrushItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
{
return BRUSH_GRAPHIC_VERSION;
@@ -3554,14 +3482,17 @@ sal_uInt16 SvxBrushItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
static inline sal_Int8 lcl_PercentToTransparency(long nPercent)
{
- //0xff must not be returned!
+ // 0xff must not be returned!
return sal_Int8(nPercent ? (50 + 0xfe * nPercent) / 100 : 0);
}
+
+
sal_Int8 SvxBrushItem::TransparencyToPercent(sal_Int32 nTrans)
{
return (sal_Int8)((nTrans * 100 + 127) / 254);
}
+
bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
@@ -3627,7 +3558,6 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
}
-
bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
nMemberId &= ~CONVERT_TWIPS;
@@ -3748,7 +3678,6 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
-
bool SvxBrushItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
@@ -3775,7 +3704,6 @@ bool SvxBrushItem::GetPresentation
}
-
SvxBrushItem& SvxBrushItem::operator=( const SvxBrushItem& rItem )
{
aColor = rItem.aColor;
@@ -3802,7 +3730,6 @@ SvxBrushItem& SvxBrushItem::operator=( const SvxBrushItem& rItem )
}
-
bool SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
@@ -3842,21 +3769,18 @@ bool SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const
}
-
SfxPoolItem* SvxBrushItem::Clone( SfxItemPool* ) const
{
return new SvxBrushItem( *this );
}
-
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 );
@@ -3894,12 +3818,12 @@ SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ )
}
-
void SvxBrushItem::PurgeMedium() const
{
DELETEZ( pImpl->pStream );
}
+
const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) const
{
if ( bLoadAgain && !maStrLink.isEmpty() && !pImpl->pGraphicObject )
@@ -3965,14 +3889,13 @@ const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) co
return pImpl->pGraphicObject;
}
-//UUUU
+
sal_Int8 SvxBrushItem::getGraphicTransparency() const
{
return pImpl->nGraphicTransparency;
}
-// -----------------------------------------------------------------------
-//UUUU
+
void SvxBrushItem::setGraphicTransparency(sal_Int8 nNew)
{
if(nNew != pImpl->nGraphicTransparency)
@@ -3982,8 +3905,6 @@ void SvxBrushItem::setGraphicTransparency(sal_Int8 nNew)
}
}
-// -----------------------------------------------------------------------
-
const Graphic* SvxBrushItem::GetGraphic(OUString const & referer) const
{
@@ -3992,7 +3913,6 @@ const Graphic* SvxBrushItem::GetGraphic(OUString const & referer) const
}
-
void SvxBrushItem::SetGraphicPos( SvxGraphicPosition eNew )
{
eGraphicPos = eNew;
@@ -4013,7 +3933,6 @@ void SvxBrushItem::SetGraphicPos( SvxGraphicPosition eNew )
}
-
void SvxBrushItem::SetGraphic( const Graphic& rNew )
{
if ( maStrLink.isEmpty() )
@@ -4035,7 +3954,6 @@ void SvxBrushItem::SetGraphic( const Graphic& rNew )
}
-
void SvxBrushItem::SetGraphicObject( const GraphicObject& rNewObj )
{
if ( maStrLink.isEmpty() )
@@ -4057,7 +3975,6 @@ void SvxBrushItem::SetGraphicObject( const GraphicObject& rNewObj )
}
-
void SvxBrushItem::SetGraphicLink( const OUString& rNew )
{
if ( rNew.isEmpty() )
@@ -4070,22 +3987,22 @@ void SvxBrushItem::SetGraphicLink( const OUString& rNew )
}
-
void SvxBrushItem::SetGraphicFilter( const OUString& rNew )
{
maStrFilter = rNew;
}
+
void SvxBrushItem::SetShadingValue( const sal_Int32 nNew )
{
nShadingValue = nNew;
}
-//static
+
SvxGraphicPosition SvxBrushItem::WallpaperStyle2GraphicPos( WallpaperStyle eStyle )
{
SvxGraphicPosition eResult;
- // The switch is not the fastest, but the safest
+ // This switch is not the fastest, but the safest
switch( eStyle )
{
case WallpaperStyle::NONE: eResult = GPOS_NONE; break;
@@ -4105,7 +4022,7 @@ SvxGraphicPosition SvxBrushItem::WallpaperStyle2GraphicPos( WallpaperStyle eStyl
return eResult;
};
-//static
+
WallpaperStyle SvxBrushItem::GraphicPos2WallpaperStyle( SvxGraphicPosition ePos )
{
WallpaperStyle eResult;
@@ -4128,6 +4045,7 @@ WallpaperStyle SvxBrushItem::GraphicPos2WallpaperStyle( SvxGraphicPosition ePos
return eResult;
}
+
SvxBrushItem::SvxBrushItem( const CntWallpaperItem& rItem, sal_uInt16 _nWhich ) :
SfxPoolItem ( _nWhich ),
nShadingValue ( ShadingPattern::CLEAR ),
@@ -4149,6 +4067,7 @@ SvxBrushItem::SvxBrushItem( const CntWallpaperItem& rItem, sal_uInt16 _nWhich )
}
}
+
void SvxBrushItem::ApplyGraphicTransparency_Impl()
{
DBG_ASSERT(pImpl->pGraphicObject, "no GraphicObject available" );
@@ -4161,6 +4080,7 @@ void SvxBrushItem::ApplyGraphicTransparency_Impl()
}
}
+
void SvxBrushItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("svxBrushItem"));
@@ -4174,7 +4094,6 @@ void SvxBrushItem::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterEndElement(pWriter);
}
-// class SvxFrameDirectionItem ----------------------------------------------
SvxFrameDirectionItem::SvxFrameDirectionItem( SvxFrameDirection nValue ,
sal_uInt16 _nWhich )
@@ -4182,10 +4101,12 @@ SvxFrameDirectionItem::SvxFrameDirectionItem( SvxFrameDirection nValue ,
{
}
+
SvxFrameDirectionItem::~SvxFrameDirectionItem()
{
}
+
bool SvxFrameDirectionItem::operator==( const SfxPoolItem& rCmp ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rCmp), "unequal types" );
@@ -4193,11 +4114,13 @@ bool SvxFrameDirectionItem::operator==( const SfxPoolItem& rCmp ) const
return GetValue() == static_cast<const SvxFrameDirectionItem&>(rCmp).GetValue();
}
+
SfxPoolItem* SvxFrameDirectionItem::Clone( SfxItemPool * ) const
{
return new SvxFrameDirectionItem( *this );
}
+
SfxPoolItem* SvxFrameDirectionItem::Create( SvStream & rStrm, sal_uInt16 /*nVer*/ ) const
{
sal_uInt16 nValue;
@@ -4205,6 +4128,7 @@ SfxPoolItem* SvxFrameDirectionItem::Create( SvStream & rStrm, sal_uInt16 /*nVer*
return new SvxFrameDirectionItem( (SvxFrameDirection)nValue, Which() );
}
+
SvStream& SvxFrameDirectionItem::Store( SvStream & rStrm, sal_uInt16 /*nIVer*/ ) const
{
sal_uInt16 nValue = GetValue();
@@ -4212,11 +4136,13 @@ SvStream& SvxFrameDirectionItem::Store( SvStream & rStrm, sal_uInt16 /*nIVer*/ )
return rStrm;
}
+
sal_uInt16 SvxFrameDirectionItem::GetVersion( sal_uInt16 nFVer ) const
{
return SOFFICE_FILEFORMAT_50 > nFVer ? USHRT_MAX : 0;
}
+
bool SvxFrameDirectionItem::GetPresentation(
SfxItemPresentation /*ePres*/,
SfxMapUnit /*eCoreUnit*/,
@@ -4227,6 +4153,7 @@ bool SvxFrameDirectionItem::GetPresentation(
return true;
}
+
bool SvxFrameDirectionItem::PutValue( const css::uno::Any& rVal,
sal_uInt8 )
{
@@ -4261,6 +4188,7 @@ bool SvxFrameDirectionItem::PutValue( const css::uno::Any& rVal,
return bRet;
}
+
bool SvxFrameDirectionItem::QueryValue( css::uno::Any& rVal,
sal_uInt8 ) const
{