[Libreoffice-commits] core.git: sw/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 20 08:14:10 UTC 2020
sw/source/core/doc/gctable.cxx | 4 -
sw/source/core/doc/tblrwcl.cxx | 22 ++---
sw/source/core/docnode/ndtbl.cxx | 40 +++++-----
sw/source/core/inc/UndoOverwrite.hxx | 18 ++--
sw/source/core/inc/UndoSplitMove.hxx | 14 +--
sw/source/core/inc/tblrwcl.hxx | 48 ++++++------
sw/source/core/undo/unovwr.cxx | 134 +++++++++++++++++------------------
sw/source/core/undo/unspnd.cxx | 44 +++++------
8 files changed, 162 insertions(+), 162 deletions(-)
New commits:
commit 962af7111ca23769d30778a4d5d7cbd7c9453d28
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Jul 20 09:04:01 2020 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Jul 20 10:13:36 2020 +0200
sw: prefix members of SwCollectTableLineBoxes, SwUndoOverwrite, ...
... SwUndoSplitNode and SwUndoTransliterate
See tdf#94879 for motivation.
Change-Id: I539d4336ce0346bff6ddc44e3ab39b8fe4ff31de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99022
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx
index 8a7105c43a38..355eb70538dd 100644
--- a/sw/source/core/doc/gctable.cxx
+++ b/sw/source/core/doc/gctable.cxx
@@ -39,8 +39,8 @@ bool SwGCBorder_BoxBrd::CheckLeftBorderOfFormat( const SwFrameFormat& rFormat )
const SvxBorderLine* pBrd = static_cast<const SvxBoxItem*>(pItem)->GetLeft();
if( pBrd )
{
- if( *pBrdLn == *pBrd )
- bAnyBorderFnd = true;
+ if( *m_pBorderLine == *pBrd )
+ m_bAnyBorderFind = true;
return true;
}
}
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 9fabc3e00a99..c70697466c36 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -3210,8 +3210,8 @@ bool SwTable::SetRowHeight( SwTableBox& rCurrentBox, TableChgWidthHeightType eTy
SwFrameFormat* SwShareBoxFormat::GetFormat( long nWidth ) const
{
SwFrameFormat *pRet = nullptr, *pTmp;
- for( auto n = aNewFormats.size(); n; )
- if( ( pTmp = aNewFormats[ --n ])->GetFrameSize().GetWidth()
+ for( auto n = m_aNewFormats.size(); n; )
+ if( ( pTmp = m_aNewFormats[ --n ])->GetFrameSize().GetWidth()
== nWidth )
{
pRet = pTmp;
@@ -3225,9 +3225,9 @@ SwFrameFormat* SwShareBoxFormat::GetFormat( const SfxPoolItem& rItem ) const
const SfxPoolItem* pItem;
sal_uInt16 nWhich = rItem.Which();
SwFrameFormat *pRet = nullptr, *pTmp;
- const SfxPoolItem& rFrameSz = pOldFormat->GetFormatAttr( RES_FRM_SIZE, false );
- for( auto n = aNewFormats.size(); n; )
- if( SfxItemState::SET == ( pTmp = aNewFormats[ --n ])->
+ const SfxPoolItem& rFrameSz = m_pOldFormat->GetFormatAttr( RES_FRM_SIZE, false );
+ for( auto n = m_aNewFormats.size(); n; )
+ if( SfxItemState::SET == ( pTmp = m_aNewFormats[ --n ])->
GetItemState( nWhich, false, &pItem ) && *pItem == rItem &&
pTmp->GetFormatAttr( RES_FRM_SIZE, false ) == rFrameSz )
{
@@ -3239,19 +3239,19 @@ SwFrameFormat* SwShareBoxFormat::GetFormat( const SfxPoolItem& rItem ) const
void SwShareBoxFormat::AddFormat( SwFrameFormat& rNew )
{
- aNewFormats.push_back( &rNew );
+ m_aNewFormats.push_back( &rNew );
}
bool SwShareBoxFormat::RemoveFormat( const SwFrameFormat& rFormat )
{
// returns true, if we can delete
- if( pOldFormat == &rFormat )
+ if( m_pOldFormat == &rFormat )
return true;
- std::vector<SwFrameFormat*>::iterator it = std::find( aNewFormats.begin(), aNewFormats.end(), &rFormat );
- if( aNewFormats.end() != it )
- aNewFormats.erase( it );
- return aNewFormats.empty();
+ std::vector<SwFrameFormat*>::iterator it = std::find( m_aNewFormats.begin(), m_aNewFormats.end(), &rFormat );
+ if( m_aNewFormats.end() != it )
+ m_aNewFormats.erase( it );
+ return m_aNewFormats.empty();
}
SwShareBoxFormats::~SwShareBoxFormats()
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 2cde2f38f190..b6cf2ff3d685 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -2899,39 +2899,39 @@ void SwDoc::SetRowsToRepeat( SwTable &rTable, sal_uInt16 nSet )
void SwCollectTableLineBoxes::AddToUndoHistory( const SwContentNode& rNd )
{
- if( pHst )
- pHst->Add( rNd.GetFormatColl(), rNd.GetIndex(), SwNodeType::Text );
+ if( m_pHistory )
+ m_pHistory->Add( rNd.GetFormatColl(), rNd.GetIndex(), SwNodeType::Text );
}
void SwCollectTableLineBoxes::AddBox( const SwTableBox& rBox )
{
- aPosArr.push_back(nWidth);
+ m_aPositionArr.push_back(m_nWidth);
SwTableBox* p = const_cast<SwTableBox*>(&rBox);
m_Boxes.push_back(p);
- nWidth = nWidth + static_cast<sal_uInt16>(rBox.GetFrameFormat()->GetFrameSize().GetWidth());
+ m_nWidth = m_nWidth + static_cast<sal_uInt16>(rBox.GetFrameFormat()->GetFrameSize().GetWidth());
}
const SwTableBox* SwCollectTableLineBoxes::GetBoxOfPos( const SwTableBox& rBox )
{
const SwTableBox* pRet = nullptr;
- if( !aPosArr.empty() )
+ if( !m_aPositionArr.empty() )
{
std::vector<sal_uInt16>::size_type n;
- for( n = 0; n < aPosArr.size(); ++n )
- if( aPosArr[ n ] == nWidth )
+ for( n = 0; n < m_aPositionArr.size(); ++n )
+ if( m_aPositionArr[ n ] == m_nWidth )
break;
- else if( aPosArr[ n ] > nWidth )
+ else if( m_aPositionArr[ n ] > m_nWidth )
{
if( n )
--n;
break;
}
- if( n >= aPosArr.size() )
+ if( n >= m_aPositionArr.size() )
--n;
- nWidth = nWidth + static_cast<sal_uInt16>(rBox.GetFrameFormat()->GetFrameSize().GetWidth());
+ m_nWidth = m_nWidth + static_cast<sal_uInt16>(rBox.GetFrameFormat()->GetFrameSize().GetWidth());
pRet = m_Boxes[ n ];
}
return pRet;
@@ -2939,14 +2939,14 @@ const SwTableBox* SwCollectTableLineBoxes::GetBoxOfPos( const SwTableBox& rBox )
bool SwCollectTableLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth )
{
- if( !aPosArr.empty() )
+ if( !m_aPositionArr.empty() )
{
std::vector<sal_uInt16>::size_type n;
- for( n = 0; n < aPosArr.size(); ++n )
+ for( n = 0; n < m_aPositionArr.size(); ++n )
{
- if( aPosArr[ n ] == nOffset )
+ if( m_aPositionArr[ n ] == nOffset )
break;
- else if( aPosArr[ n ] > nOffset )
+ else if( m_aPositionArr[ n ] > nOffset )
{
if( n )
--n;
@@ -2954,10 +2954,10 @@ bool SwCollectTableLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth )
}
}
- aPosArr.erase( aPosArr.begin(), aPosArr.begin() + n );
+ m_aPositionArr.erase( m_aPositionArr.begin(), m_aPositionArr.begin() + n );
m_Boxes.erase(m_Boxes.begin(), m_Boxes.begin() + n);
- size_t nArrSize = aPosArr.size();
+ size_t nArrSize = m_aPositionArr.size();
if (nArrSize)
{
if (nOldWidth == 0)
@@ -2966,14 +2966,14 @@ bool SwCollectTableLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth )
// Adapt the positions to the new Size
for( n = 0; n < nArrSize; ++n )
{
- sal_uLong nSize = nWidth;
- nSize *= ( aPosArr[ n ] - nOffset );
+ sal_uLong nSize = m_nWidth;
+ nSize *= ( m_aPositionArr[ n ] - nOffset );
nSize /= nOldWidth;
- aPosArr[ n ] = sal_uInt16( nSize );
+ m_aPositionArr[ n ] = sal_uInt16( nSize );
}
}
}
- return !aPosArr.empty();
+ return !m_aPositionArr.empty();
}
bool sw_Line_CollectBox( const SwTableLine*& rpLine, void* pPara )
diff --git a/sw/source/core/inc/UndoOverwrite.hxx b/sw/source/core/inc/UndoOverwrite.hxx
index 1a21a87a8ee4..af798e8d44b0 100644
--- a/sw/source/core/inc/UndoOverwrite.hxx
+++ b/sw/source/core/inc/UndoOverwrite.hxx
@@ -33,12 +33,12 @@ namespace utl {
class SwUndoOverwrite: public SwUndo, private SwUndoSaveContent
{
- OUString aDelStr, aInsStr;
- std::unique_ptr<SwRedlineSaveDatas> pRedlSaveData;
- sal_uLong nSttNode;
- sal_Int32 nSttContent;
- bool bInsChar : 1; // no Overwrite, but Insert
- bool bGroup : 1; // TRUE: is already grouped; evaluated in CanGrouping()
+ OUString m_aDelStr, m_aInsStr;
+ std::unique_ptr<SwRedlineSaveDatas> m_pRedlSaveData;
+ sal_uLong m_nStartNode;
+ sal_Int32 m_nStartContent;
+ bool m_bInsChar : 1; // no Overwrite, but Insert
+ bool m_bGroup : 1; // TRUE: is already grouped; evaluated in CanGrouping()
public:
SwUndoOverwrite( SwDoc*, SwPosition&, sal_Unicode cIns );
@@ -68,8 +68,8 @@ public:
struct UndoTransliterate_Data;
class SwUndoTransliterate : public SwUndo, public SwUndRng
{
- std::vector< std::unique_ptr<UndoTransliterate_Data> > aChanges;
- TransliterationFlags nType;
+ std::vector< std::unique_ptr<UndoTransliterate_Data> > m_aChanges;
+ TransliterationFlags m_nType;
void DoTransliterate(SwDoc & rDoc, SwPaM const & rPam);
@@ -85,7 +85,7 @@ public:
void AddChanges( SwTextNode& rTNd, sal_Int32 nStart, sal_Int32 nLen,
css::uno::Sequence <sal_Int32> const & rOffsets );
- bool HasData() const { return aChanges.size() > 0; }
+ bool HasData() const { return m_aChanges.size() > 0; }
};
#endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOOVERWRITE_HXX
diff --git a/sw/source/core/inc/UndoSplitMove.hxx b/sw/source/core/inc/UndoSplitMove.hxx
index ad779ee44362..44a3a8e970cf 100644
--- a/sw/source/core/inc/UndoSplitMove.hxx
+++ b/sw/source/core/inc/UndoSplitMove.hxx
@@ -25,12 +25,12 @@
class SwUndoSplitNode: public SwUndo
{
std::unique_ptr<SwHistory> m_pHistory;
- std::unique_ptr<SwRedlineData> pRedlData;
- sal_uLong nNode;
- sal_Int32 nContent;
- bool bTableFlag : 1;
- bool bChkTableStt : 1;
- sal_uInt32 nParRsid;
+ std::unique_ptr<SwRedlineData> m_pRedlineData;
+ sal_uLong m_nNode;
+ sal_Int32 m_nContent;
+ bool m_bTableFlag : 1;
+ bool m_bCheckTableStart : 1;
+ sal_uInt32 m_nParRsid;
public:
SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos, bool bChkTable );
@@ -41,7 +41,7 @@ public:
virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
virtual void RepeatImpl( ::sw::RepeatContext & ) override;
- void SetTableFlag() { bTableFlag = true; }
+ void SetTableFlag() { m_bTableFlag = true; }
};
class SwUndoMove : public SwUndo, private SwUndRng, private SwUndoSaveContent
diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx
index 8d78bae0051d..4deba61bc65e 100644
--- a/sw/source/core/inc/tblrwcl.hxx
+++ b/sw/source/core/inc/tblrwcl.hxx
@@ -60,19 +60,19 @@ void DeleteBox_( SwTable& rTable, SwTableBox* pBox, SwUndo* pUndo,
*/
class SwCollectTableLineBoxes
{
- std::vector<sal_uInt16> aPosArr;
+ std::vector<sal_uInt16> m_aPositionArr;
std::vector<SwTableBox*> m_Boxes;
- SwHistory* pHst;
- SplitTable_HeadlineOption nMode;
- sal_uInt16 nWidth;
- bool bGetFromTop : 1;
- bool bGetValues : 1;
+ SwHistory* m_pHistory;
+ SplitTable_HeadlineOption m_nMode;
+ sal_uInt16 m_nWidth;
+ bool m_bGetFromTop : 1;
+ bool m_bGetValues : 1;
public:
SwCollectTableLineBoxes( bool bTop, SplitTable_HeadlineOption nMd = SplitTable_HeadlineOption::NONE, SwHistory* pHist=nullptr )
:
- pHst( pHist ), nMode( nMd ), nWidth( 0 ),
- bGetFromTop( bTop ), bGetValues( true )
+ m_pHistory( pHist ), m_nMode( nMd ), m_nWidth( 0 ),
+ m_bGetFromTop( bTop ), m_bGetValues( true )
{}
@@ -85,17 +85,17 @@ public:
{
// We need the EndPos of the column here!
if( pWidth )
- *pWidth = (nPos+1 == aPosArr.size()) ? nWidth
- : aPosArr[ nPos+1 ];
+ *pWidth = (nPos+1 == m_aPositionArr.size()) ? m_nWidth
+ : m_aPositionArr[ nPos+1 ];
return *m_Boxes[ nPos ];
}
- bool IsGetFromTop() const { return bGetFromTop; }
- bool IsGetValues() const { return bGetValues; }
+ bool IsGetFromTop() const { return m_bGetFromTop; }
+ bool IsGetValues() const { return m_bGetValues; }
- SplitTable_HeadlineOption GetMode() const { return nMode; }
- void SetValues( bool bFlag ) { bGetValues = false; nWidth = 0;
- bGetFromTop = bFlag; }
+ SplitTable_HeadlineOption GetMode() const { return m_nMode; }
+ void SetValues( bool bFlag ) { m_bGetValues = false; m_nWidth = 0;
+ m_bGetFromTop = bFlag; }
bool Resize( sal_uInt16 nOffset, sal_uInt16 nWidth );
};
@@ -131,13 +131,13 @@ struct SwGCLineBorder
class SwGCBorder_BoxBrd
{
- const editeng::SvxBorderLine* pBrdLn;
- bool bAnyBorderFnd;
+ const editeng::SvxBorderLine* m_pBorderLine;
+ bool m_bAnyBorderFind;
public:
- SwGCBorder_BoxBrd() : pBrdLn( nullptr ), bAnyBorderFnd( false ) {}
+ SwGCBorder_BoxBrd() : m_pBorderLine( nullptr ), m_bAnyBorderFind( false ) {}
void SetBorder( const editeng::SvxBorderLine& rBorderLine )
- { pBrdLn = &rBorderLine; bAnyBorderFnd = false; }
+ { m_pBorderLine = &rBorderLine; m_bAnyBorderFind = false; }
/**
* Check whether the left Border is the same as the set one
@@ -145,22 +145,22 @@ public:
*/
bool CheckLeftBorderOfFormat( const SwFrameFormat& rFormat );
- bool IsAnyBorderFound() const { return bAnyBorderFnd; }
+ bool IsAnyBorderFound() const { return m_bAnyBorderFind; }
};
void sw_GC_Line_Border( const SwTableLine* pLine, SwGCLineBorder* pGCPara );
class SwShareBoxFormat
{
- const SwFrameFormat* pOldFormat;
- std::vector<SwFrameFormat*> aNewFormats;
+ const SwFrameFormat* m_pOldFormat;
+ std::vector<SwFrameFormat*> m_aNewFormats;
public:
SwShareBoxFormat( const SwFrameFormat& rFormat )
- : pOldFormat( &rFormat )
+ : m_pOldFormat( &rFormat )
{}
- const SwFrameFormat& GetOldFormat() const { return *pOldFormat; }
+ const SwFrameFormat& GetOldFormat() const { return *m_pOldFormat; }
SwFrameFormat* GetFormat( long nWidth ) const;
SwFrameFormat* GetFormat( const SfxPoolItem& rItem ) const;
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 7361da5a4930..56fa55b35b4f 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -41,41 +41,41 @@ using namespace ::com::sun::star::uno;
SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
sal_Unicode cIns )
: SwUndo(SwUndoId::OVERWRITE, pDoc),
- bGroup( false )
+ m_bGroup( false )
{
SwTextNode *const pTextNd = rPos.nNode.GetNode().GetTextNode();
assert(pTextNd);
sal_Int32 const nTextNdLen = pTextNd->GetText().getLength();
- nSttNode = rPos.nNode.GetIndex();
- nSttContent = rPos.nContent.GetIndex();
+ m_nStartNode = rPos.nNode.GetIndex();
+ m_nStartContent = rPos.nContent.GetIndex();
if( !pDoc->getIDocumentRedlineAccess().IsIgnoreRedline() && !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() )
{
SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(),
rPos.nNode, rPos.nContent.GetIndex()+1 );
- pRedlSaveData.reset( new SwRedlineSaveDatas );
- if( !FillSaveData( aPam, *pRedlSaveData, false ))
+ m_pRedlSaveData.reset( new SwRedlineSaveDatas );
+ if( !FillSaveData( aPam, *m_pRedlSaveData, false ))
{
- pRedlSaveData.reset();
+ m_pRedlSaveData.reset();
}
- if (nSttContent < nTextNdLen)
+ if (m_nStartContent < nTextNdLen)
{
pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, RedlineType::Any);
}
}
- bInsChar = true;
- if( nSttContent < nTextNdLen ) // no pure insert?
+ m_bInsChar = true;
+ if( m_nStartContent < nTextNdLen ) // no pure insert?
{
- aDelStr += OUStringChar( pTextNd->GetText()[nSttContent] );
+ m_aDelStr += OUStringChar( pTextNd->GetText()[m_nStartContent] );
if( !m_pHistory )
m_pHistory.reset( new SwHistory );
SwRegHistory aRHst( *pTextNd, m_pHistory.get() );
- m_pHistory->CopyAttr( pTextNd->GetpSwpHints(), nSttNode, 0,
+ m_pHistory->CopyAttr( pTextNd->GetpSwpHints(), m_nStartNode, 0,
nTextNdLen, false );
++rPos.nContent;
- bInsChar = false;
+ m_bInsChar = false;
}
bool bOldExpFlg = pTextNd->IsIgnoreDontExpand();
@@ -83,9 +83,9 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
pTextNd->InsertText( OUString(cIns), rPos.nContent,
SwInsertFlags::EMPTYEXPAND );
- aInsStr += OUStringChar( cIns );
+ m_aInsStr += OUStringChar( cIns );
- if( !bInsChar )
+ if( !m_bInsChar )
{
const SwIndex aTmpIndex( rPos.nContent, -2 );
pTextNd->EraseText( aTmpIndex, 1 );
@@ -105,15 +105,15 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
// What is with only inserted characters?
// Only deletion of single chars can be combined.
- if( rPos.nNode != nSttNode || aInsStr.isEmpty() ||
- ( !bGroup && aInsStr.getLength() != 1 ))
+ if( rPos.nNode != m_nStartNode || m_aInsStr.isEmpty() ||
+ ( !m_bGroup && m_aInsStr.getLength() != 1 ))
return false;
// Is the node a TextNode at all?
SwTextNode * pDelTextNd = rPos.nNode.GetNode().GetTextNode();
if( !pDelTextNd ||
(pDelTextNd->GetText().getLength() != rPos.nContent.GetIndex() &&
- rPos.nContent.GetIndex() != ( nSttContent + aInsStr.getLength() )))
+ rPos.nContent.GetIndex() != ( m_nStartContent + m_aInsStr.getLength() )))
return false;
CharClass& rCC = GetAppCharClass();
@@ -121,10 +121,10 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
// ask the char that should be inserted
if (( CH_TXTATR_BREAKWORD == cIns || CH_TXTATR_INWORD == cIns ) ||
rCC.isLetterNumeric( OUString( cIns ), 0 ) !=
- rCC.isLetterNumeric( aInsStr, aInsStr.getLength()-1 ) )
+ rCC.isLetterNumeric( m_aInsStr, m_aInsStr.getLength()-1 ) )
return false;
- if (!bInsChar && rPos.nContent.GetIndex() < pDelTextNd->GetText().getLength())
+ if (!m_bInsChar && rPos.nContent.GetIndex() < pDelTextNd->GetText().getLength())
{
SwRedlineSaveDatas aTmpSav;
SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(),
@@ -132,10 +132,10 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
const bool bSaved = FillSaveData( aPam, aTmpSav, false );
- bool bOk = ( !pRedlSaveData && !bSaved ) ||
- ( pRedlSaveData && bSaved &&
- SwUndo::CanRedlineGroup( *pRedlSaveData, aTmpSav,
- nSttContent > rPos.nContent.GetIndex() ));
+ bool bOk = ( !m_pRedlSaveData && !bSaved ) ||
+ ( m_pRedlSaveData && bSaved &&
+ SwUndo::CanRedlineGroup( *m_pRedlSaveData, aTmpSav,
+ m_nStartContent > rPos.nContent.GetIndex() ));
// aTmpSav.DeleteAndDestroyAll();
if( !bOk )
return false;
@@ -144,15 +144,15 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
}
// both 'overwrites' can be combined so 'move' the corresponding character
- if( !bInsChar )
+ if( !m_bInsChar )
{
if (rPos.nContent.GetIndex() < pDelTextNd->GetText().getLength())
{
- aDelStr += OUStringChar( pDelTextNd->GetText()[rPos.nContent.GetIndex()] );
+ m_aDelStr += OUStringChar( pDelTextNd->GetText()[rPos.nContent.GetIndex()] );
++rPos.nContent;
}
else
- bInsChar = true;
+ m_bInsChar = true;
}
bool bOldExpFlg = pDelTextNd->IsIgnoreDontExpand();
@@ -162,16 +162,16 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
SwInsertFlags::EMPTYEXPAND) );
assert(ins.getLength() == 1); // check in SwDoc::Overwrite => cannot fail
(void) ins;
- aInsStr += OUStringChar( cIns );
+ m_aInsStr += OUStringChar( cIns );
- if( !bInsChar )
+ if( !m_bInsChar )
{
const SwIndex aTmpIndex( rPos.nContent, -2 );
pDelTextNd->EraseText( aTmpIndex, 1 );
}
pDelTextNd->SetIgnoreDontExpand( bOldExpFlg );
- bGroup = true;
+ m_bGroup = true;
return true;
}
@@ -181,38 +181,38 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext)
SwPaM *const pCurrentPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pCurrentPam->DeleteMark();
- pCurrentPam->GetPoint()->nNode = nSttNode;
+ pCurrentPam->GetPoint()->nNode = m_nStartNode;
SwTextNode* pTextNd = pCurrentPam->GetNode().GetTextNode();
assert(pTextNd);
SwIndex& rIdx = pCurrentPam->GetPoint()->nContent;
- rIdx.Assign( pTextNd, nSttContent );
+ rIdx.Assign( pTextNd, m_nStartContent );
SwAutoCorrExceptWord* pACEWord = pDoc->GetAutoCorrExceptWord();
if( pACEWord )
{
- if( 1 == aInsStr.getLength() && 1 == aDelStr.getLength() )
- pACEWord->CheckChar( *pCurrentPam->GetPoint(), aDelStr[0] );
+ if( 1 == m_aInsStr.getLength() && 1 == m_aDelStr.getLength() )
+ pACEWord->CheckChar( *pCurrentPam->GetPoint(), m_aDelStr[0] );
pDoc->SetAutoCorrExceptWord( nullptr );
}
// If there was not only an overwrite but also an insert, delete the surplus
- if( aInsStr.getLength() > aDelStr.getLength() )
+ if( m_aInsStr.getLength() > m_aDelStr.getLength() )
{
- rIdx += aDelStr.getLength();
- pTextNd->EraseText( rIdx, aInsStr.getLength() - aDelStr.getLength() );
- rIdx = nSttContent;
+ rIdx += m_aDelStr.getLength();
+ pTextNd->EraseText( rIdx, m_aInsStr.getLength() - m_aDelStr.getLength() );
+ rIdx = m_nStartContent;
}
- if( !aDelStr.isEmpty() )
+ if( !m_aDelStr.isEmpty() )
{
bool bOldExpFlg = pTextNd->IsIgnoreDontExpand();
pTextNd->SetIgnoreDontExpand( true );
++rIdx;
- for( sal_Int32 n = 0; n < aDelStr.getLength(); n++ )
+ for( sal_Int32 n = 0; n < m_aDelStr.getLength(); n++ )
{
// do it individually, to keep the attributes!
- OUString aTmpStr(aDelStr[n]);
+ OUString aTmpStr(m_aDelStr[n]);
OUString const ins( pTextNd->InsertText(aTmpStr, rIdx) );
assert(ins.getLength() == 1); // cannot fail
(void) ins;
@@ -231,30 +231,30 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext)
m_pHistory->TmpRollback( pDoc, 0, false );
}
- if( pCurrentPam->GetMark()->nContent.GetIndex() != nSttContent )
+ if( pCurrentPam->GetMark()->nContent.GetIndex() != m_nStartContent )
{
pCurrentPam->SetMark();
- pCurrentPam->GetMark()->nContent = nSttContent;
+ pCurrentPam->GetMark()->nContent = m_nStartContent;
}
- if( pRedlSaveData )
- SetSaveData( *pDoc, *pRedlSaveData );
+ if( m_pRedlSaveData )
+ SetSaveData( *pDoc, *m_pRedlSaveData );
}
void SwUndoOverwrite::RepeatImpl(::sw::RepeatContext & rContext)
{
SwPaM *const pCurrentPam = & rContext.GetRepeatPaM();
- if( aInsStr.isEmpty() || pCurrentPam->HasMark() )
+ if( m_aInsStr.isEmpty() || pCurrentPam->HasMark() )
return;
SwDoc & rDoc = rContext.GetDoc();
{
::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
- rDoc.getIDocumentContentOperations().Overwrite(*pCurrentPam, OUString(aInsStr[0]));
+ rDoc.getIDocumentContentOperations().Overwrite(*pCurrentPam, OUString(m_aInsStr[0]));
}
- for( sal_Int32 n = 1; n < aInsStr.getLength(); ++n )
- rDoc.getIDocumentContentOperations().Overwrite( *pCurrentPam, OUString(aInsStr[n]) );
+ for( sal_Int32 n = 1; n < m_aInsStr.getLength(); ++n )
+ rDoc.getIDocumentContentOperations().Overwrite( *pCurrentPam, OUString(m_aInsStr[n]) );
}
void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext)
@@ -263,37 +263,37 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext)
SwPaM *const pCurrentPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pCurrentPam->DeleteMark();
- pCurrentPam->GetPoint()->nNode = nSttNode;
+ pCurrentPam->GetPoint()->nNode = m_nStartNode;
SwTextNode* pTextNd = pCurrentPam->GetNode().GetTextNode();
assert(pTextNd);
SwIndex& rIdx = pCurrentPam->GetPoint()->nContent;
- if( pRedlSaveData )
+ if( m_pRedlSaveData )
{
- rIdx.Assign( pTextNd, nSttContent );
+ rIdx.Assign( pTextNd, m_nStartContent );
pCurrentPam->SetMark();
- pCurrentPam->GetMark()->nContent += aDelStr.getLength();
+ pCurrentPam->GetMark()->nContent += m_aDelStr.getLength();
pDoc->getIDocumentRedlineAccess().DeleteRedline( *pCurrentPam, false, RedlineType::Any );
pCurrentPam->DeleteMark();
}
- rIdx.Assign( pTextNd, !aDelStr.isEmpty() ? nSttContent+1 : nSttContent );
+ rIdx.Assign( pTextNd, !m_aDelStr.isEmpty() ? m_nStartContent+1 : m_nStartContent );
bool bOldExpFlg = pTextNd->IsIgnoreDontExpand();
pTextNd->SetIgnoreDontExpand( true );
- for( sal_Int32 n = 0; n < aInsStr.getLength(); n++ )
+ for( sal_Int32 n = 0; n < m_aInsStr.getLength(); n++ )
{
// do it individually, to keep the attributes!
OUString const ins(
- pTextNd->InsertText( OUString(aInsStr[n]), rIdx,
+ pTextNd->InsertText( OUString(m_aInsStr[n]), rIdx,
SwInsertFlags::EMPTYEXPAND) );
assert(ins.getLength() == 1); // cannot fail
(void) ins;
- if( n < aDelStr.getLength() )
+ if( n < m_aDelStr.getLength() )
{
rIdx -= 2;
pTextNd->EraseText( rIdx, 1 );
- rIdx += n+1 < aDelStr.getLength() ? 2 : 1;
+ rIdx += n+1 < m_aDelStr.getLength() ? 2 : 1;
}
}
pTextNd->SetIgnoreDontExpand( bOldExpFlg );
@@ -301,10 +301,10 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext)
// get back old start position from UndoNodes array
if( m_pHistory )
m_pHistory->SetTmpEnd( m_pHistory->Count() );
- if( pCurrentPam->GetMark()->nContent.GetIndex() != nSttContent )
+ if( pCurrentPam->GetMark()->nContent.GetIndex() != m_nStartContent )
{
pCurrentPam->SetMark();
- pCurrentPam->GetMark()->nContent = nSttContent;
+ pCurrentPam->GetMark()->nContent = m_nStartContent;
}
}
@@ -313,7 +313,7 @@ SwRewriter SwUndoOverwrite::GetRewriter() const
SwRewriter aResult;
OUString aString = SwResId(STR_START_QUOTE) +
- ShortenString(aInsStr, nUndoStringLength, SwResId(STR_LDOTS)) +
+ ShortenString(m_aInsStr, nUndoStringLength, SwResId(STR_LDOTS)) +
SwResId(STR_END_QUOTE);
aResult.AddRule(UndoArg1, aString);
@@ -340,7 +340,7 @@ struct UndoTransliterate_Data
SwUndoTransliterate::SwUndoTransliterate(
const SwPaM& rPam,
const utl::TransliterationWrapper& rTrans )
- : SwUndo( SwUndoId::TRANSLITERATE, rPam.GetDoc() ), SwUndRng( rPam ), nType( rTrans.getType() )
+ : SwUndo( SwUndoId::TRANSLITERATE, rPam.GetDoc() ), SwUndRng( rPam ), m_nType( rTrans.getType() )
{
}
@@ -356,8 +356,8 @@ void SwUndoTransliterate::UndoImpl(::sw::UndoRedoContext & rContext)
// the start, we need to revert them from the start towards the end now to keep the
// offset information of the undo data in sync with the changing text.
// Thus we need to iterate from the end of the vector to the start
- for (sal_Int32 i = aChanges.size() - 1; i >= 0; --i)
- aChanges[i]->SetChangeAtNode( rDoc );
+ for (sal_Int32 i = m_aChanges.size() - 1; i >= 0; --i)
+ m_aChanges[i]->SetChangeAtNode( rDoc );
AddUndoRedoPaM(rContext, true);
}
@@ -375,7 +375,7 @@ void SwUndoTransliterate::RepeatImpl(::sw::RepeatContext & rContext)
void SwUndoTransliterate::DoTransliterate(SwDoc & rDoc, SwPaM const & rPam)
{
- utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), nType );
+ utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), m_nType );
rDoc.getIDocumentContentOperations().TransliterateText( rPam, aTrans );
}
@@ -388,7 +388,7 @@ void SwUndoTransliterate::AddChanges( SwTextNode& rTNd,
rTNd.GetIndex(), nStart, static_cast<sal_Int32>(nOffsLen),
rTNd.GetText().copy(nStart, nLen));
- aChanges.push_back( std::unique_ptr<UndoTransliterate_Data>(pNew) );
+ m_aChanges.push_back( std::unique_ptr<UndoTransliterate_Data>(pNew) );
const sal_Int32* pOffsets = rOffsets.getConstArray();
// where did we need less memory ?
@@ -423,9 +423,9 @@ void SwUndoTransliterate::AddChanges( SwTextNode& rTNd,
// and then we need to save the attributes/bookmarks
// but this data must moved every time to the last in the chain!
- for (size_t i = 0; i + 1 < aChanges.size(); ++i) // check all changes but not the current one
+ for (size_t i = 0; i + 1 < m_aChanges.size(); ++i) // check all changes but not the current one
{
- UndoTransliterate_Data* pD = aChanges[i].get();
+ UndoTransliterate_Data* pD = m_aChanges[i].get();
if( pD->nNdIdx == pNew->nNdIdx && pD->pHistory )
{
// same node and have a history?
diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx
index 112db668dbc2..54129f3c8363 100644
--- a/sw/source/core/undo/unspnd.cxx
+++ b/sw/source/core/undo/unspnd.cxx
@@ -36,16 +36,16 @@
SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
bool bChkTable )
- : SwUndo( SwUndoId::SPLITNODE, pDoc ), nNode( rPos.nNode.GetIndex() ),
- nContent( rPos.nContent.GetIndex() ),
- bTableFlag( false ), bChkTableStt( bChkTable )
+ : SwUndo( SwUndoId::SPLITNODE, pDoc ), m_nNode( rPos.nNode.GetIndex() ),
+ m_nContent( rPos.nContent.GetIndex() ),
+ m_bTableFlag( false ), m_bCheckTableStart( bChkTable )
{
SwTextNode *const pTextNd = rPos.nNode.GetNode().GetTextNode();
OSL_ENSURE( pTextNd, "only for TextNode" );
if( pTextNd->GetpSwpHints() )
{
m_pHistory.reset(new SwHistory);
- m_pHistory->CopyAttr(pTextNd->GetpSwpHints(), nNode, 0,
+ m_pHistory->CopyAttr(pTextNd->GetpSwpHints(), m_nNode, 0,
pTextNd->GetText().getLength(), false );
if (!m_pHistory->Count())
{
@@ -55,17 +55,17 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
// consider Redline
if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
{
- pRedlData.reset( new SwRedlineData( RedlineType::Insert, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) );
+ m_pRedlineData.reset( new SwRedlineData( RedlineType::Insert, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) );
SetRedlineFlags( pDoc->getIDocumentRedlineAccess().GetRedlineFlags() );
}
- nParRsid = pTextNd->GetParRsid();
+ m_nParRsid = pTextNd->GetParRsid();
}
SwUndoSplitNode::~SwUndoSplitNode()
{
m_pHistory.reset();
- pRedlData.reset();
+ m_pRedlineData.reset();
}
void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext)
@@ -73,13 +73,13 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext)
SwDoc *const pDoc = & rContext.GetDoc();
SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
rPam.DeleteMark();
- if( bTableFlag )
+ if( m_bTableFlag )
{
// than a TextNode was added directly before the current table
SwNodeIndex& rIdx = rPam.GetPoint()->nNode;
- rIdx = nNode;
+ rIdx = m_nNode;
SwTextNode* pTNd;
- SwNode* pCurrNd = pDoc->GetNodes()[ nNode + 1 ];
+ SwNode* pCurrNd = pDoc->GetNodes()[ m_nNode + 1 ];
SwTableNode* pTableNd = pCurrNd->FindTableNode();
if( pCurrNd->IsContentNode() && pTableNd &&
nullptr != ( pTNd = pDoc->GetNodes()[ pTableNd->GetIndex()-1 ]->GetTextNode() ))
@@ -108,7 +108,7 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext)
}
else
{
- SwTextNode * pTNd = pDoc->GetNodes()[ nNode ]->GetTextNode();
+ SwTextNode * pTNd = pDoc->GetNodes()[ m_nNode ]->GetTextNode();
if( pTNd )
{
rPam.GetPoint()->nNode = *pTNd;
@@ -124,7 +124,7 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext)
rPam.DeleteMark();
}
- RemoveIdxRel( nNode+1, *rPam.GetPoint() );
+ RemoveIdxRel( m_nNode+1, *rPam.GetPoint() );
pTNd->JoinNext();
if (m_pHistory)
@@ -137,46 +137,46 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext)
m_pHistory->TmpRollback( pDoc, 0, false );
}
- pDoc->UpdateParRsid( pTNd, nParRsid );
+ pDoc->UpdateParRsid( pTNd, m_nParRsid );
}
}
// also set the cursor onto undo section
rPam.DeleteMark();
- rPam.GetPoint()->nNode = nNode;
- rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), nContent );
+ rPam.GetPoint()->nNode = m_nNode;
+ rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), m_nContent );
}
void SwUndoSplitNode::RedoImpl(::sw::UndoRedoContext & rContext)
{
SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
- rPam.GetPoint()->nNode = nNode;
+ rPam.GetPoint()->nNode = m_nNode;
SwTextNode * pTNd = rPam.GetNode().GetTextNode();
OSL_ENSURE(pTNd, "SwUndoSplitNode::RedoImpl(): SwTextNode expected");
if (pTNd)
{
- rPam.GetPoint()->nContent.Assign( pTNd, nContent );
+ rPam.GetPoint()->nContent.Assign( pTNd, m_nContent );
SwDoc* pDoc = rPam.GetDoc();
- pDoc->getIDocumentContentOperations().SplitNode( *rPam.GetPoint(), bChkTableStt );
+ pDoc->getIDocumentContentOperations().SplitNode( *rPam.GetPoint(), m_bCheckTableStart );
if (m_pHistory)
{
m_pHistory->SetTmpEnd(m_pHistory->Count());
}
- if( ( pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) ||
+ if( ( m_pRedlineData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) ||
( !( RedlineFlags::Ignore & GetRedlineFlags() ) &&
!pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() ))
{
rPam.SetMark();
if( rPam.Move( fnMoveBackward ))
{
- if( pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() ))
+ if( m_pRedlineData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() ))
{
RedlineFlags eOld = pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
pDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern(eOld & ~RedlineFlags::Ignore);
- pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( *pRedlData, rPam ), true);
+ pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( *m_pRedlineData, rPam ), true);
pDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
}
else
@@ -191,7 +191,7 @@ void SwUndoSplitNode::RedoImpl(::sw::UndoRedoContext & rContext)
void SwUndoSplitNode::RepeatImpl(::sw::RepeatContext & rContext)
{
rContext.GetDoc().getIDocumentContentOperations().SplitNode(
- *rContext.GetRepeatPaM().GetPoint(), bChkTableStt );
+ *rContext.GetRepeatPaM().GetPoint(), m_bCheckTableStart );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list