Kaydet (Commit) 6f599126 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: prefix members of SwTableAutoFormat

Change-Id: I17515ea4e444986f50d554c864540a625a521970
Reviewed-on: https://gerrit.libreoffice.org/66984Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
üst 7545d180
......@@ -247,19 +247,19 @@ class SW_DLLPUBLIC SwTableAutoFormat
css::uno::WeakReference<css::uno::XInterface> m_wXObject;
OUString m_aName;
sal_uInt16 nStrResId;
sal_uInt16 m_nStrResId;
// Common flags of Calc and Writer.
bool bInclFont : 1;
bool bInclJustify : 1;
bool bInclFrame : 1;
bool bInclBackground : 1;
bool bInclValueFormat : 1;
bool m_bInclFont : 1;
bool m_bInclJustify : 1;
bool m_bInclFrame : 1;
bool m_bInclBackground : 1;
bool m_bInclValueFormat : 1;
// Calc specific flags.
bool bInclWidthHeight : 1;
bool m_bInclWidthHeight : 1;
SwBoxAutoFormat* aBoxAutoFormat[ 16 ];
SwBoxAutoFormat* m_aBoxAutoFormat[ 16 ];
// Writer-specific options
SvxFormatBreakItem m_aBreak;
......@@ -285,7 +285,7 @@ public:
SwBoxAutoFormat& GetBoxFormat( sal_uInt8 nPos );
static const SwBoxAutoFormat& GetDefaultBoxFormat();
void SetName( const OUString& rNew ) { m_aName = rNew; nStrResId = USHRT_MAX; }
void SetName( const OUString& rNew ) { m_aName = rNew; m_nStrResId = USHRT_MAX; }
const OUString& GetName() const { return m_aName; }
void UpdateFromSet( sal_uInt8 nPos, const SfxItemSet& rSet,
......@@ -296,23 +296,23 @@ public:
void RestoreTableProperties(SwTable &table) const;
void StoreTableProperties(const SwTable &table);
bool IsFont() const { return bInclFont; }
bool IsJustify() const { return bInclJustify; }
bool IsFrame() const { return bInclFrame; }
bool IsBackground() const { return bInclBackground; }
bool IsValueFormat() const { return bInclValueFormat; }
bool IsFont() const { return m_bInclFont; }
bool IsJustify() const { return m_bInclJustify; }
bool IsFrame() const { return m_bInclFrame; }
bool IsBackground() const { return m_bInclBackground; }
bool IsValueFormat() const { return m_bInclValueFormat; }
/// Check if style is hidden.
bool IsHidden() const { return m_bHidden; }
/// Check if style is defined by user.
bool IsUserDefined() const { return m_bUserDefined; }
void SetFont( const bool bNew ) { bInclFont = bNew; }
void SetJustify( const bool bNew ) { bInclJustify = bNew; }
void SetFrame( const bool bNew ) { bInclFrame = bNew; }
void SetBackground( const bool bNew ) { bInclBackground = bNew; }
void SetValueFormat( const bool bNew ) { bInclValueFormat = bNew; }
void SetWidthHeight( const bool bNew ) { bInclWidthHeight = bNew; }
void SetFont( const bool bNew ) { m_bInclFont = bNew; }
void SetJustify( const bool bNew ) { m_bInclJustify = bNew; }
void SetFrame( const bool bNew ) { m_bInclFrame = bNew; }
void SetBackground( const bool bNew ) { m_bInclBackground = bNew; }
void SetValueFormat( const bool bNew ) { m_bInclValueFormat = bNew; }
void SetWidthHeight( const bool bNew ) { m_bInclWidthHeight = bNew; }
/// Set if style is hidden.
void SetHidden(bool bHidden) { m_bHidden = bHidden; }
......
......@@ -1354,19 +1354,19 @@ void SwDocTest::testTableAutoFormats()
aTableAF.m_aShadow = aShadow;
//Set bInclFont
bool aIFont = false;
aTableAF.bInclFont = aIFont;
aTableAF.m_bInclFont = aIFont;
//Set bInclJustify
bool aIJustify = false;
aTableAF.bInclJustify = aIJustify;
aTableAF.m_bInclJustify = aIJustify;
//Set bInclFrame
bool aIFrame = false;
aTableAF.bInclFrame = aIFrame;
aTableAF.m_bInclFrame = aIFrame;
//Set bInclBackground
bool aIBackground = false;
aTableAF.bInclBackground = aIBackground;
aTableAF.m_bInclBackground = aIBackground;
//Set bInclValueFormat
bool aIVFormat = false;
aTableAF.bInclValueFormat = aIVFormat;
aTableAF.m_bInclValueFormat = aIVFormat;
//set the box format to AutoFormat
aTableAF.SetBoxFormat( aBoxAF, sal_uInt8(0) );
......@@ -1492,15 +1492,15 @@ void SwDocTest::testTableAutoFormats()
//Get m_aShadow
CPPUNIT_ASSERT( bool( pLoadAF->m_aShadow == aShadow ) );
//Get bInclFont
CPPUNIT_ASSERT( bool( pLoadAF->bInclFont == aIFont ) );
CPPUNIT_ASSERT( bool( pLoadAF->m_bInclFont == aIFont ) );
//Get bInclJustify
CPPUNIT_ASSERT( bool( pLoadAF->bInclJustify == aIJustify ) );
CPPUNIT_ASSERT( bool( pLoadAF->m_bInclJustify == aIJustify ) );
//Get bInclFrame
CPPUNIT_ASSERT( bool( pLoadAF->bInclFrame == aIFrame ) );
CPPUNIT_ASSERT( bool( pLoadAF->m_bInclFrame == aIFrame ) );
//Get bInclBackground
CPPUNIT_ASSERT( bool( pLoadAF->bInclBackground == aIBackground ) );
CPPUNIT_ASSERT( bool( pLoadAF->m_bInclBackground == aIBackground ) );
//Get bInclValueFormat
CPPUNIT_ASSERT( bool( pLoadAF->bInclValueFormat == aIVFormat ) );
CPPUNIT_ASSERT( bool( pLoadAF->m_bInclValueFormat == aIVFormat ) );
}
static OUString
......
......@@ -598,7 +598,7 @@ void SwBoxAutoFormat::SaveVersionNo( SvStream& rStream, sal_uInt16 fileVersion )
SwTableAutoFormat::SwTableAutoFormat( const OUString& rName )
: m_aName( rName )
, nStrResId( USHRT_MAX )
, m_nStrResId( USHRT_MAX )
, m_aBreak( SvxBreak::NONE, RES_BREAK )
, m_aKeepWithNextPara( false, RES_KEEP )
, m_aRepeatHeading( 0 )
......@@ -609,14 +609,14 @@ SwTableAutoFormat::SwTableAutoFormat( const OUString& rName )
, m_bHidden( false )
, m_bUserDefined( true )
{
bInclFont = true;
bInclJustify = true;
bInclFrame = true;
bInclBackground = true;
bInclValueFormat = true;
bInclWidthHeight = true;
memset( aBoxAutoFormat, 0, sizeof( aBoxAutoFormat ) );
m_bInclFont = true;
m_bInclJustify = true;
m_bInclFrame = true;
m_bInclBackground = true;
m_bInclValueFormat = true;
m_bInclWidthHeight = true;
memset( m_aBoxAutoFormat, 0, sizeof( m_aBoxAutoFormat ) );
}
SwTableAutoFormat::SwTableAutoFormat( const SwTableAutoFormat& rNew )
......@@ -624,7 +624,7 @@ SwTableAutoFormat::SwTableAutoFormat( const SwTableAutoFormat& rNew )
, m_aKeepWithNextPara( false, RES_KEEP )
, m_aShadow( RES_SHADOW )
{
for(SwBoxAutoFormat* & rp : aBoxAutoFormat)
for(SwBoxAutoFormat* & rp : m_aBoxAutoFormat)
rp = nullptr;
*this = rNew;
}
......@@ -636,24 +636,24 @@ SwTableAutoFormat& SwTableAutoFormat::operator=( const SwTableAutoFormat& rNew )
for( sal_uInt8 n = 0; n < 16; ++n )
{
if( aBoxAutoFormat[ n ] )
delete aBoxAutoFormat[ n ];
if( m_aBoxAutoFormat[ n ] )
delete m_aBoxAutoFormat[ n ];
SwBoxAutoFormat* pFormat = rNew.aBoxAutoFormat[ n ];
SwBoxAutoFormat* pFormat = rNew.m_aBoxAutoFormat[ n ];
if( pFormat ) // if is set -> copy
aBoxAutoFormat[ n ] = new SwBoxAutoFormat( *pFormat );
m_aBoxAutoFormat[ n ] = new SwBoxAutoFormat( *pFormat );
else // else default
aBoxAutoFormat[ n ] = nullptr;
m_aBoxAutoFormat[ n ] = nullptr;
}
m_aName = rNew.m_aName;
nStrResId = rNew.nStrResId;
bInclFont = rNew.bInclFont;
bInclJustify = rNew.bInclJustify;
bInclFrame = rNew.bInclFrame;
bInclBackground = rNew.bInclBackground;
bInclValueFormat = rNew.bInclValueFormat;
bInclWidthHeight = rNew.bInclWidthHeight;
m_nStrResId = rNew.m_nStrResId;
m_bInclFont = rNew.m_bInclFont;
m_bInclJustify = rNew.m_bInclJustify;
m_bInclFrame = rNew.m_bInclFrame;
m_bInclBackground = rNew.m_bInclBackground;
m_bInclValueFormat = rNew.m_bInclValueFormat;
m_bInclWidthHeight = rNew.m_bInclWidthHeight;
m_aBreak = rNew.m_aBreak;
m_aPageDesc = rNew.m_aPageDesc;
......@@ -671,7 +671,7 @@ SwTableAutoFormat& SwTableAutoFormat::operator=( const SwTableAutoFormat& rNew )
SwTableAutoFormat::~SwTableAutoFormat()
{
SwBoxAutoFormat** ppFormat = aBoxAutoFormat;
SwBoxAutoFormat** ppFormat = m_aBoxAutoFormat;
for( sal_uInt8 n = 0; n < 16; ++n, ++ppFormat )
if( *ppFormat )
delete *ppFormat;
......@@ -681,18 +681,18 @@ void SwTableAutoFormat::SetBoxFormat( const SwBoxAutoFormat& rNew, sal_uInt8 nPo
{
OSL_ENSURE( nPos < 16, "wrong area" );
SwBoxAutoFormat* pFormat = aBoxAutoFormat[ nPos ];
SwBoxAutoFormat* pFormat = m_aBoxAutoFormat[ nPos ];
if( pFormat ) // if is set -> copy
*aBoxAutoFormat[ nPos ] = rNew;
*m_aBoxAutoFormat[ nPos ] = rNew;
else // else set anew
aBoxAutoFormat[ nPos ] = new SwBoxAutoFormat( rNew );
m_aBoxAutoFormat[ nPos ] = new SwBoxAutoFormat( rNew );
}
const SwBoxAutoFormat& SwTableAutoFormat::GetBoxFormat( sal_uInt8 nPos ) const
{
OSL_ENSURE( nPos < 16, "wrong area" );
SwBoxAutoFormat* pFormat = aBoxAutoFormat[ nPos ];
SwBoxAutoFormat* pFormat = m_aBoxAutoFormat[ nPos ];
if( pFormat ) // if is set -> copy
return *pFormat;
else // else return the default
......@@ -708,7 +708,7 @@ SwBoxAutoFormat& SwTableAutoFormat::GetBoxFormat( sal_uInt8 nPos )
{
SAL_WARN_IF(!(nPos < 16), "sw.core", "GetBoxFormat wrong area");
SwBoxAutoFormat** pFormat = &aBoxAutoFormat[ nPos ];
SwBoxAutoFormat** pFormat = &m_aBoxAutoFormat[ nPos ];
if( !*pFormat )
{
// If default doesn't exist yet:
......@@ -734,11 +734,11 @@ void SwTableAutoFormat::UpdateFromSet( sal_uInt8 nPos,
{
OSL_ENSURE( nPos < 16, "wrong area" );
SwBoxAutoFormat* pFormat = aBoxAutoFormat[ nPos ];
SwBoxAutoFormat* pFormat = m_aBoxAutoFormat[ nPos ];
if( !pFormat ) // if is set -> copy
{
pFormat = new SwBoxAutoFormat;
aBoxAutoFormat[ nPos ] = pFormat;
m_aBoxAutoFormat[ nPos ] = pFormat;
}
if( SwTableAutoFormatUpdateFlags::Char & eFlags )
......@@ -980,23 +980,23 @@ bool SwTableAutoFormat::Load( SvStream& rStream, const SwAfVersions& rVersions )
m_aName = rStream.ReadUniOrByteString( eCharSet );
if( AUTOFORMAT_DATA_ID_552 <= nVal )
{
rStream.ReadUInt16( nStrResId );
rStream.ReadUInt16( m_nStrResId );
// start from 3d because default is added via constructor
sal_uInt16 nId = RES_POOLTABLESTYLE_3D + nStrResId;
sal_uInt16 nId = RES_POOLTABLESTYLE_3D + m_nStrResId;
if( RES_POOLTABLESTYLE_3D <= nId &&
nId < RES_POOLTABSTYLE_END )
{
m_aName = SwStyleNameMapper::GetUIName(nId, m_aName);
}
else
nStrResId = USHRT_MAX;
m_nStrResId = USHRT_MAX;
}
rStream.ReadCharAsBool( b ); bInclFont = b;
rStream.ReadCharAsBool( b ); bInclJustify = b;
rStream.ReadCharAsBool( b ); bInclFrame = b;
rStream.ReadCharAsBool( b ); bInclBackground = b;
rStream.ReadCharAsBool( b ); bInclValueFormat = b;
rStream.ReadCharAsBool( b ); bInclWidthHeight = b;
rStream.ReadCharAsBool( b ); m_bInclFont = b;
rStream.ReadCharAsBool( b ); m_bInclJustify = b;
rStream.ReadCharAsBool( b ); m_bInclFrame = b;
rStream.ReadCharAsBool( b ); m_bInclBackground = b;
rStream.ReadCharAsBool( b ); m_bInclValueFormat = b;
rStream.ReadCharAsBool( b ); m_bInclWidthHeight = b;
if (nVal >= AUTOFORMAT_DATA_ID_31005 && WriterSpecificBlockExists(rStream))
{
......@@ -1018,7 +1018,7 @@ bool SwTableAutoFormat::Load( SvStream& rStream, const SwAfVersions& rVersions )
SwBoxAutoFormat* pFormat = new SwBoxAutoFormat;
bRet = pFormat->Load( rStream, rVersions, nVal );
if( bRet )
aBoxAutoFormat[ i ] = pFormat;
m_aBoxAutoFormat[ i ] = pFormat;
else
{
delete pFormat;
......@@ -1036,13 +1036,13 @@ bool SwTableAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
// --- from 680/dr25 on: store strings as UTF-8
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStream, m_aName,
RTL_TEXTENCODING_UTF8 );
rStream.WriteUInt16( nStrResId );
rStream.WriteBool( bInclFont );
rStream.WriteBool( bInclJustify );
rStream.WriteBool( bInclFrame );
rStream.WriteBool( bInclBackground );
rStream.WriteBool( bInclValueFormat );
rStream.WriteBool( bInclWidthHeight );
rStream.WriteUInt16( m_nStrResId );
rStream.WriteBool( m_bInclFont );
rStream.WriteBool( m_bInclJustify );
rStream.WriteBool( m_bInclFrame );
rStream.WriteBool( m_bInclBackground );
rStream.WriteBool( m_bInclValueFormat );
rStream.WriteBool( m_bInclWidthHeight );
{
WriterSpecificAutoFormatBlock block(rStream);
......@@ -1058,7 +1058,7 @@ bool SwTableAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
for( int i = 0; bRet && i < 16; ++i )
{
SwBoxAutoFormat* pFormat = aBoxAutoFormat[ i ];
SwBoxAutoFormat* pFormat = m_aBoxAutoFormat[ i ];
if( !pFormat ) // if not set -> write default
{
// If it doesn't exist yet:
......@@ -1075,7 +1075,7 @@ OUString SwTableAutoFormat::GetTableTemplateCellSubName(const SwBoxAutoFormat& r
{
sal_Int32 nIndex = 0;
for (; nIndex < 16; ++nIndex)
if (aBoxAutoFormat[nIndex] == &rBoxFormat) break;
if (m_aBoxAutoFormat[nIndex] == &rBoxFormat) break;
// box format doesn't belong to this table format
if (16 <= nIndex)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment