[Libreoffice-commits] core.git: sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon May 8 10:55:02 UTC 2017
sw/source/core/inc/SwXMLTextBlocks.hxx | 2
sw/source/core/inc/swblocks.hxx | 36 +++----
sw/source/core/swg/SwXMLTextBlocks.cxx | 96 ++++++++++-----------
sw/source/core/swg/SwXMLTextBlocks1.cxx | 32 +++----
sw/source/core/swg/swblocks.cxx | 146 ++++++++++++++++----------------
5 files changed, 156 insertions(+), 156 deletions(-)
New commits:
commit ad7fade3ed62341fe3e6bbfb399c4b8f5bb9da83
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon May 8 09:03:56 2017 +0200
sw: prefix members of SwImpBlocks
Change-Id: I6ffe2eb6a1c401ccaa031be5d9ce9fae488d0014
Reviewed-on: https://gerrit.libreoffice.org/37376
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sw/source/core/inc/SwXMLTextBlocks.hxx b/sw/source/core/inc/SwXMLTextBlocks.hxx
index 59a1a10c7325..33193704242f 100644
--- a/sw/source/core/inc/SwXMLTextBlocks.hxx
+++ b/sw/source/core/inc/SwXMLTextBlocks.hxx
@@ -88,7 +88,7 @@ public:
virtual bool PutMuchEntries( bool bOn ) override;
public:
- SwDoc* GetDoc() const { return pDoc; }
+ SwDoc* GetDoc() const { return m_pDoc; }
//void SetDoc( SwDoc * pNewDoc);
sal_uLong StartPutBlock( const OUString& rShort, const OUString& rPackageName );
sal_uLong PutBlock( SwPaM& rPaM, const OUString& rLong );
diff --git a/sw/source/core/inc/swblocks.hxx b/sw/source/core/inc/swblocks.hxx
index a759ea52315e..a75e0bbac6fc 100644
--- a/sw/source/core/inc/swblocks.hxx
+++ b/sw/source/core/inc/swblocks.hxx
@@ -52,19 +52,19 @@ class SwImpBlocks
{
friend class SwTextBlocks;
protected:
- OUString aFile; // Physical file name
- OUString aName; // Logical file name
- OUString aCur; // Current text
- OUString aShort, aLong; // Short- and longname (PutDoc)
- OUString sBaseURL; // Base URL - has to be set at the Readers and Writers
- SwBlockNames aNames; // List of all Blocks
- Date aDateModified; // For aligning the Actions
- tools::Time aTimeModified;
- SwDoc* pDoc; // Document to be switched
- sal_uInt16 nCur; // Current Index
- bool bReadOnly : 1;
- bool bInPutMuchBlocks : 1; // Put several block entries
- bool bInfoChanged : 1; // Whether any info of TextBlock changed
+ OUString m_aFile; // Physical file name
+ OUString m_aName; // Logical file name
+ OUString m_aCurrentText; // Current text
+ OUString m_aShort, m_aLong; // Short- and longname (PutDoc)
+ OUString m_sBaseURL; // Base URL - has to be set at the Readers and Writers
+ SwBlockNames m_aNames; // List of all Blocks
+ Date m_aDateModified; // For aligning the Actions
+ tools::Time m_aTimeModified;
+ SwDoc* m_pDoc; // Document to be switched
+ sal_uInt16 m_nCurrentIndex; // Current Index
+ bool m_bReadOnly : 1;
+ bool m_bInPutMuchBlocks : 1; // Put several block entries
+ bool m_bInfoChanged : 1; // Whether any info of TextBlock changed
explicit SwImpBlocks( const OUString& );
@@ -94,14 +94,14 @@ public:
OUString GetLongName( sal_uInt16 ) const; /// Return longname for index
OUString GetPackageName( sal_uInt16 ) const; /// Return packagename for index
- const OUString& GetFileName() const {return aFile;} /// Return physical file name
+ const OUString& GetFileName() const {return m_aFile;} /// Return physical file name
void SetName( const OUString& rName ) /// Logic name
- { aName = rName; bInfoChanged = true; }
+ { m_aName = rName; m_bInfoChanged = true; }
const OUString& GetName()
- { return aName; }
+ { return m_aName; }
- const OUString& GetBaseURL() const { return sBaseURL;}
- void SetBaseURL( const OUString& rURL ) { sBaseURL = rURL; }
+ const OUString& GetBaseURL() const { return m_sBaseURL;}
+ void SetBaseURL( const OUString& rURL ) { m_sBaseURL = rURL; }
virtual sal_uLong Delete( sal_uInt16 ) = 0;
virtual sal_uLong Rename( sal_uInt16, const OUString&, const OUString& ) = 0;
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index 5660a4cc4725..2a361c5eb8b6 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -62,20 +62,20 @@ SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile )
SwDocShell* pDocSh = new SwDocShell ( SfxObjectCreateMode::INTERNAL );
if( !pDocSh->DoInitNew() )
return;
- bReadOnly = true;
- pDoc = pDocSh->GetDoc();
+ m_bReadOnly = true;
+ m_pDoc = pDocSh->GetDoc();
xDocShellRef = pDocSh;
- pDoc->SetOle2Link( Link<bool,void>() );
- pDoc->GetIDocumentUndoRedo().DoUndo(false);
- pDoc->acquire();
+ m_pDoc->SetOle2Link( Link<bool,void>() );
+ m_pDoc->GetIDocumentUndoRedo().DoUndo(false);
+ m_pDoc->acquire();
uno::Reference< embed::XStorage > refStg;
- if( !aDateModified.GetDate() || !aTimeModified.GetTime() )
+ if( !m_aDateModified.GetDate() || !m_aTimeModified.GetTime() )
Touch(); // If it's created anew -> get a new timestamp
try
{
refStg = comphelper::OStorageHelper::GetStorageFromURL( rFile, embed::ElementModes::READWRITE );
- bReadOnly = false;
+ m_bReadOnly = false;
}
catch(const uno::Exception&)
{
@@ -95,7 +95,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile )
InitBlockMode ( refStg );
ReadInfo();
ResetBlockMode ();
- bInfoChanged = false;
+ m_bInfoChanged = false;
}
SwXMLTextBlocks::SwXMLTextBlocks( const uno::Reference < embed::XStorage >& rStg, const OUString& rName )
@@ -105,37 +105,37 @@ SwXMLTextBlocks::SwXMLTextBlocks( const uno::Reference < embed::XStorage >& rStg
SwDocShell* pDocSh = new SwDocShell ( SfxObjectCreateMode::INTERNAL );
if( !pDocSh->DoInitNew() )
return;
- bReadOnly = false;
- pDoc = pDocSh->GetDoc();
+ m_bReadOnly = false;
+ m_pDoc = pDocSh->GetDoc();
xDocShellRef = pDocSh;
- pDoc->SetOle2Link( Link<bool,void>() );
- pDoc->GetIDocumentUndoRedo().DoUndo(false);
- pDoc->acquire();
+ m_pDoc->SetOle2Link( Link<bool,void>() );
+ m_pDoc->GetIDocumentUndoRedo().DoUndo(false);
+ m_pDoc->acquire();
InitBlockMode ( rStg );
ReadInfo();
- bInfoChanged = false;
+ m_bInfoChanged = false;
}
SwXMLTextBlocks::~SwXMLTextBlocks()
{
- if ( bInfoChanged )
+ if ( m_bInfoChanged )
WriteInfo();
ResetBlockMode ();
if(xDocShellRef.is())
xDocShellRef->DoClose();
xDocShellRef = nullptr;
- if( pDoc && !pDoc->release() )
- delete pDoc;
+ if( m_pDoc && !m_pDoc->release() )
+ delete m_pDoc;
}
void SwXMLTextBlocks::ClearDoc()
{
- SwDocShell * pDocShell = pDoc->GetDocShell();
+ SwDocShell * pDocShell = m_pDoc->GetDocShell();
pDocShell->InvalidateModel();
pDocShell->ReactivateModel();
- pDoc->ClearDoc();
+ m_pDoc->ClearDoc();
pDocShell->ClearEmbeddedObjects();
}
@@ -151,19 +151,19 @@ void SwXMLTextBlocks::AddName( const OUString& rShort, const OUString& rLong,
sal_uInt16 nIdx = GetIndex( rShort );
if (nIdx != USHRT_MAX)
{
- delete aNames[nIdx];
- aNames.erase( aNames.begin() + nIdx );
+ delete m_aNames[nIdx];
+ m_aNames.erase( m_aNames.begin() + nIdx );
}
SwBlockName* pNew = new SwBlockName( rShort, rLong, rPackageName );
pNew->bIsOnlyTextFlagInit = true;
pNew->bIsOnlyText = bOnlyText;
- aNames.insert( pNew );
- bInfoChanged = true;
+ m_aNames.insert( pNew );
+ m_bInfoChanged = true;
}
sal_uLong SwXMLTextBlocks::Delete( sal_uInt16 n )
{
- const OUString aPckName (aNames[n]->aPackageName);
+ const OUString aPckName (m_aNames[n]->aPackageName);
uno::Reference < container::XNameAccess > xAccess( xBlkRoot, uno::UNO_QUERY );
if ( xAccess.is() &&
xAccess->hasByName( aPckName ) && xBlkRoot->isStreamElement( aPckName ) )
@@ -189,9 +189,9 @@ sal_uLong SwXMLTextBlocks::Rename( sal_uInt16 nIdx, const OUString& rNewShort, c
OSL_ENSURE( xBlkRoot.is(), "No storage set" );
if(!xBlkRoot.is())
return 0;
- OUString aOldName (aNames[nIdx]->aPackageName);
- aShort = rNewShort;
- aPackageName = GeneratePackageName( aShort );
+ OUString aOldName (m_aNames[nIdx]->aPackageName);
+ m_aShort = rNewShort;
+ aPackageName = GeneratePackageName( m_aShort );
if(aOldName != aPackageName)
{
@@ -309,8 +309,8 @@ sal_uLong SwXMLTextBlocks::StartPutBlock( const OUString& rShort, const OUString
sal_uLong SwXMLTextBlocks::BeginPutDoc( const OUString& rShort, const OUString& rLong )
{
// Store in base class
- aShort = rShort;
- aLong = rLong;
+ m_aShort = rShort;
+ m_aLong = rLong;
aPackageName = GeneratePackageName( rShort );
SetIsTextOnly( rShort, false);
return StartPutBlock (rShort, aPackageName);
@@ -323,13 +323,13 @@ sal_uLong SwXMLTextBlocks::PutBlock( SwPaM& , const OUString& )
WriterRef xWrt;
::GetXMLWriter ( OUString(), GetBaseURL(), xWrt);
- SwWriter aWriter (xRoot, *pDoc );
+ SwWriter aWriter (xRoot, *m_pDoc );
xWrt->bBlock = true;
nRes = aWriter.Write ( xWrt );
xWrt->bBlock = false;
// Save OLE objects if there are some
- SwDocShell *pDocSh = pDoc->GetDocShell();
+ SwDocShell *pDocSh = m_pDoc->GetDocShell();
bool bHasChildren = pDocSh && pDocSh->GetEmbeddedObjectContainer().HasEmbeddedObjects();
if( !nRes && bHasChildren )
@@ -395,7 +395,7 @@ sal_uLong SwXMLTextBlocks::PutBlock( SwPaM& , const OUString& )
sal_uLong SwXMLTextBlocks::PutDoc()
{
SwPaM* pPaM = MakePaM();
- sal_uLong nErr = PutBlock(*pPaM, aLong);
+ sal_uLong nErr = PutBlock(*pPaM, m_aLong);
delete pPaM;
return nErr;
}
@@ -416,7 +416,7 @@ bool SwXMLTextBlocks::PutMuchEntries( bool bOn )
bool bRet = false;
if( bOn )
{
- if( bInPutMuchBlocks )
+ if( m_bInPutMuchBlocks )
{
OSL_ENSURE( false, "Nested calls are not allowed");
}
@@ -426,11 +426,11 @@ bool SwXMLTextBlocks::PutMuchEntries( bool bOn )
if( bRet )
{
nFlags |= SwXmlFlags::NoRootCommit;
- bInPutMuchBlocks = true;
+ m_bInPutMuchBlocks = true;
}
}
}
- else if( bInPutMuchBlocks )
+ else if( m_bInPutMuchBlocks )
{
nFlags &= ~SwXmlFlags::NoRootCommit;
if( xBlkRoot.is() )
@@ -443,7 +443,7 @@ bool SwXMLTextBlocks::PutMuchEntries( bool bOn )
MakeBlockList();
CloseFile();
Touch();
- bInPutMuchBlocks = false;
+ m_bInPutMuchBlocks = false;
bRet = true;
}
catch (const uno::Exception&)
@@ -459,7 +459,7 @@ sal_uLong SwXMLTextBlocks::OpenFile( bool bRdOnly )
sal_uLong nRet = 0;
try
{
- uno::Reference < embed::XStorage > refStg = comphelper::OStorageHelper::GetStorageFromURL( aFile,
+ uno::Reference < embed::XStorage > refStg = comphelper::OStorageHelper::GetStorageFromURL( m_aFile,
bRdOnly ? embed::ElementModes::READ : embed::ElementModes::READWRITE );
InitBlockMode ( refStg );
}
@@ -474,7 +474,7 @@ sal_uLong SwXMLTextBlocks::OpenFile( bool bRdOnly )
void SwXMLTextBlocks::CloseFile()
{
- if (bInfoChanged)
+ if (m_bInfoChanged)
WriteInfo();
ResetBlockMode();
}
@@ -483,7 +483,7 @@ void SwXMLTextBlocks::SetIsTextOnly( const OUString& rShort, bool bNewValue )
{
sal_uInt16 nIdx = GetIndex ( rShort );
if (nIdx != USHRT_MAX)
- aNames[nIdx]->bIsOnlyText = bNewValue;
+ m_aNames[nIdx]->bIsOnlyText = bNewValue;
}
bool SwXMLTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const
@@ -492,13 +492,13 @@ bool SwXMLTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const
bool bRet = false;
if (nIdx != USHRT_MAX)
{
- bRet = aNames[nIdx]->bIsOnlyText;
+ bRet = m_aNames[nIdx]->bIsOnlyText;
}
return bRet;
}
bool SwXMLTextBlocks::IsOnlyTextBlock( sal_uInt16 nIdx ) const
{
- return aNames[nIdx]->bIsOnlyText;
+ return m_aNames[nIdx]->bIsOnlyText;
}
bool SwXMLTextBlocks::IsFileUCBStorage( const OUString & rFileName)
@@ -551,10 +551,10 @@ sal_uLong SwXMLTextBlocks::PutText( const OUString& rShort, const OUString& rNam
const OUString& rText )
{
sal_uLong nRes = 0;
- aShort = rShort;
- aLong = rName;
- aCur = rText;
- SetIsTextOnly( aShort, true );
+ m_aShort = rShort;
+ m_aLong = rName;
+ m_aCurrentText = rText;
+ SetIsTextOnly( m_aShort, true );
aPackageName = GeneratePackageName( rShort );
ClearDoc();
nRes = PutBlockText( rShort, rName, rText, aPackageName );
@@ -563,10 +563,10 @@ sal_uLong SwXMLTextBlocks::PutText( const OUString& rShort, const OUString& rNam
void SwXMLTextBlocks::MakeBlockText( const OUString& rText )
{
- SwTextNode* pTextNode = pDoc->GetNodes()[ pDoc->GetNodes().GetEndOfContent().
+ SwTextNode* pTextNode = m_pDoc->GetNodes()[ m_pDoc->GetNodes().GetEndOfContent().
GetIndex() - 1 ]->GetTextNode();
- if( pTextNode->GetTextColl() == pDoc->GetDfltTextFormatColl() )
- pTextNode->ChgFormatColl( pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ));
+ if( pTextNode->GetTextColl() == m_pDoc->GetDfltTextFormatColl() )
+ pTextNode->ChgFormatColl( m_pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ));
sal_Int32 nPos = 0;
do
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 74dcad77e6cc..efe97fc3d02d 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -64,7 +64,7 @@ sal_uLong SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx )
{
xRoot = xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ );
xMedium = new SfxMedium( xRoot, GetBaseURL(), OUString( "writer8" ) );
- SwReader aReader( *xMedium, aFolderName, pDoc );
+ SwReader aReader( *xMedium, aFolderName, m_pDoc );
ReadXML->SetBlockMode( true );
aReader.Read( *ReadXML );
ReadXML->SetBlockMode( false );
@@ -73,7 +73,7 @@ sal_uLong SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx )
OUString sObjReplacements( "ObjectReplacements" );
if ( xRoot->hasByName( sObjReplacements ) )
{
- uno::Reference< document::XStorageBasedDocument > xDocStor( pDoc->GetDocShell()->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XStorageBasedDocument > xDocStor( m_pDoc->GetDocShell()->GetModel(), uno::UNO_QUERY_THROW );
uno::Reference< embed::XStorage > xStr( xDocStor->getDocumentStorage() );
if ( xStr.is() )
{
@@ -102,12 +102,12 @@ sal_uLong SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx )
comphelper::getProcessComponentContext();
xml::sax::InputSource aParserInput;
- aParserInput.sSystemId = aNames[nIdx]->aPackageName;
+ aParserInput.sSystemId = m_aNames[nIdx]->aPackageName;
aParserInput.aInputStream = xStream->getInputStream();
// get filter
- uno::Reference< xml::sax::XFastDocumentHandler > xFilter = new SwXMLTextBlockImport( xContext, aCur, true );
+ uno::Reference< xml::sax::XFastDocumentHandler > xFilter = new SwXMLTextBlockImport( xContext, m_aCurrentText, true );
uno::Reference< xml::sax::XFastTokenHandler > xTokenHandler = new SwXMLTextBlockTokenHandler();
// connect parser and filter
@@ -136,8 +136,8 @@ sal_uLong SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx )
// re throw ?
}
- bInfoChanged = false;
- MakeBlockText(aCur);
+ m_bInfoChanged = false;
+ MakeBlockText(m_aCurrentText);
}
catch( uno::Exception& )
{
@@ -161,9 +161,9 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
SvxMacroTableDtor& rMacroTable )
{
// set current auto text
- aShort = aNames[nIdx]->aShort;
- aLong = aNames[nIdx]->aLong;
- aPackageName = aNames[nIdx]->aPackageName;
+ m_aShort = m_aNames[nIdx]->aShort;
+ m_aLong = m_aNames[nIdx]->aLong;
+ aPackageName = m_aNames[nIdx]->aPackageName;
sal_uLong nRet = 0;
@@ -187,7 +187,7 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
// prepare ParserInputSrouce
xml::sax::InputSource aParserInput;
- aParserInput.sSystemId = aName;
+ aParserInput.sSystemId = m_aName;
aParserInput.aInputStream = xInputStream;
// get service factory
@@ -292,7 +292,7 @@ sal_uLong SwXMLTextBlocks::GetBlockText( const OUString& rShort, OUString& rText
comphelper::getProcessComponentContext();
xml::sax::InputSource aParserInput;
- aParserInput.sSystemId = aName;
+ aParserInput.sSystemId = m_aName;
aParserInput.aInputStream = xContents->getInputStream();
// get filter
@@ -501,7 +501,7 @@ void SwXMLTextBlocks::WriteInfo()
{
}
- bInfoChanged = false;
+ m_bInfoChanged = false;
return;
}
}
@@ -511,9 +511,9 @@ sal_uLong SwXMLTextBlocks::SetMacroTable(
const SvxMacroTableDtor& rMacroTable )
{
// set current autotext
- aShort = aNames[nIdx]->aShort;
- aLong = aNames[nIdx]->aLong;
- aPackageName = aNames[nIdx]->aPackageName;
+ m_aShort = m_aNames[nIdx]->aShort;
+ m_aLong = m_aNames[nIdx]->aLong;
+ aPackageName = m_aNames[nIdx]->aPackageName;
// start XML autotext event export
sal_uLong nRes = 0;
@@ -523,7 +523,7 @@ sal_uLong SwXMLTextBlocks::SetMacroTable(
// Get model
uno::Reference< lang::XComponent > xModelComp(
- pDoc->GetDocShell()->GetModel(), UNO_QUERY );
+ m_pDoc->GetDocShell()->GetModel(), UNO_QUERY );
OSL_ENSURE( xModelComp.is(), "XMLWriter::Write: got no model" );
if( !xModelComp.is() )
return ERR_SWG_WRITE_ERROR;
diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx
index e9fb2a284757..0c9c31675f71 100644
--- a/sw/source/core/swg/swblocks.cxx
+++ b/sw/source/core/swg/swblocks.cxx
@@ -87,23 +87,23 @@ SwImpBlocks::FileType SwImpBlocks::GetFileType( const OUString& rFile )
}
SwImpBlocks::SwImpBlocks( const OUString& rFile )
- : aFile( rFile ),
- aDateModified( Date::EMPTY ),
- aTimeModified( tools::Time::EMPTY ),
- pDoc( nullptr ), nCur( USHRT_MAX ),
- bReadOnly( true ), bInPutMuchBlocks( false ),
- bInfoChanged(false)
+ : m_aFile( rFile ),
+ m_aDateModified( Date::EMPTY ),
+ m_aTimeModified( tools::Time::EMPTY ),
+ m_pDoc( nullptr ), m_nCurrentIndex( USHRT_MAX ),
+ m_bReadOnly( true ), m_bInPutMuchBlocks( false ),
+ m_bInfoChanged(false)
{
FStatHelper::GetModifiedDateTimeOfFile( rFile,
- &aDateModified, &aTimeModified );
+ &m_aDateModified, &m_aTimeModified );
INetURLObject aObj(rFile);
aObj.setExtension( OUString() );
- aName = aObj.GetBase();
+ m_aName = aObj.GetBase();
}
SwImpBlocks::~SwImpBlocks()
{
- aNames.DeleteAndDestroyAll();
+ m_aNames.DeleteAndDestroyAll();
}
/**
@@ -111,7 +111,7 @@ SwImpBlocks::~SwImpBlocks()
*/
void SwImpBlocks::ClearDoc()
{
- pDoc->ClearDoc();
+ m_pDoc->ClearDoc();
}
/**
@@ -119,7 +119,7 @@ void SwImpBlocks::ClearDoc()
*/
SwPaM* SwImpBlocks::MakePaM()
{
- SwPaM* pPam = new SwPaM( pDoc->GetNodes().GetEndOfContent() );
+ SwPaM* pPam = new SwPaM( m_pDoc->GetNodes().GetEndOfContent() );
pPam->Move( fnMoveBackward, GoInDoc );
pPam->SetMark();
pPam->Move( fnMoveForward, GoInDoc );
@@ -129,7 +129,7 @@ SwPaM* SwImpBlocks::MakePaM()
sal_uInt16 SwImpBlocks::GetCount() const
{
- return aNames.size();
+ return m_aNames.size();
}
/**
@@ -139,9 +139,9 @@ sal_uInt16 SwImpBlocks::GetIndex( const OUString& rShort ) const
{
const OUString s( GetAppCharClass().uppercase( rShort ) );
const sal_uInt16 nHash = Hash( s );
- for( size_t i = 0; i < aNames.size(); i++ )
+ for( size_t i = 0; i < m_aNames.size(); i++ )
{
- const SwBlockName* pName = aNames[ i ];
+ const SwBlockName* pName = m_aNames[ i ];
if( pName->nHashS == nHash
&& pName->aShort == s )
return i;
@@ -152,9 +152,9 @@ sal_uInt16 SwImpBlocks::GetIndex( const OUString& rShort ) const
sal_uInt16 SwImpBlocks::GetLongIndex( const OUString& rLong ) const
{
sal_uInt16 nHash = Hash( rLong );
- for( size_t i = 0; i < aNames.size(); i++ )
+ for( size_t i = 0; i < m_aNames.size(); i++ )
{
- const SwBlockName* pName = aNames[ i ];
+ const SwBlockName* pName = m_aNames[ i ];
if( pName->nHashL == nHash
&& pName->aLong == rLong )
return i;
@@ -164,22 +164,22 @@ sal_uInt16 SwImpBlocks::GetLongIndex( const OUString& rLong ) const
OUString SwImpBlocks::GetShortName( sal_uInt16 n ) const
{
- if( n < aNames.size() )
- return aNames[n]->aShort;
+ if( n < m_aNames.size() )
+ return m_aNames[n]->aShort;
return OUString();
}
OUString SwImpBlocks::GetLongName( sal_uInt16 n ) const
{
- if( n < aNames.size() )
- return aNames[n]->aLong;
+ if( n < m_aNames.size() )
+ return m_aNames[n]->aLong;
return OUString();
}
OUString SwImpBlocks::GetPackageName( sal_uInt16 n ) const
{
- if( n < aNames.size() )
- return aNames[n]->aPackageName;
+ if( n < m_aNames.size() )
+ return m_aNames[n]->aPackageName;
return OUString();
}
@@ -189,27 +189,27 @@ void SwImpBlocks::AddName( const OUString& rShort, const OUString& rLong,
sal_uInt16 nIdx = GetIndex( rShort );
if( nIdx != USHRT_MAX )
{
- delete aNames[nIdx];
- aNames.erase( aNames.begin() + nIdx );
+ delete m_aNames[nIdx];
+ m_aNames.erase( m_aNames.begin() + nIdx );
}
SwBlockName* pNew = new SwBlockName( rShort, rLong );
pNew->bIsOnlyTextFlagInit = true;
pNew->bIsOnlyText = bOnlyText;
- aNames.insert( pNew );
+ m_aNames.insert( pNew );
}
bool SwImpBlocks::IsFileChanged() const
{
- Date aTempDateModified( aDateModified );
- tools::Time aTempTimeModified( aTimeModified );
- return FStatHelper::GetModifiedDateTimeOfFile( aFile, &aTempDateModified, &aTempTimeModified ) &&
- ( aDateModified != aTempDateModified ||
- aTimeModified != aTempTimeModified );
+ Date aTempDateModified( m_aDateModified );
+ tools::Time aTempTimeModified( m_aTimeModified );
+ return FStatHelper::GetModifiedDateTimeOfFile( m_aFile, &aTempDateModified, &aTempTimeModified ) &&
+ ( m_aDateModified != aTempDateModified ||
+ m_aTimeModified != aTempTimeModified );
}
void SwImpBlocks::Touch()
{
- FStatHelper::GetModifiedDateTimeOfFile( aFile, &aDateModified, &aTimeModified );
+ FStatHelper::GetModifiedDateTimeOfFile( m_aFile, &m_aDateModified, &m_aTimeModified );
}
bool SwImpBlocks::IsOnlyTextBlock( const OUString& ) const
@@ -253,7 +253,7 @@ SwTextBlocks::~SwTextBlocks()
OUString SwTextBlocks::GetName()
{
- return pImp ? pImp->aName : OUString();
+ return pImp ? pImp->m_aName : OUString();
}
void SwTextBlocks::SetName( const OUString& r )
@@ -304,7 +304,7 @@ OUString SwTextBlocks::GetLongName( sal_uInt16 n ) const
bool SwTextBlocks::Delete( sal_uInt16 n )
{
- if( pImp && !pImp->bInPutMuchBlocks )
+ if( pImp && !pImp->m_bInPutMuchBlocks )
{
if( pImp->IsFileChanged() )
nErr = ERR_TXTBLOCK_NEWFILE_ERROR;
@@ -313,11 +313,11 @@ bool SwTextBlocks::Delete( sal_uInt16 n )
nErr = pImp->Delete( n );
if( !nErr )
{
- delete pImp->aNames[n];
- pImp->aNames.erase( pImp->aNames.begin() + n );
+ delete pImp->m_aNames[n];
+ pImp->m_aNames.erase( pImp->m_aNames.begin() + n );
}
- if( n == pImp->nCur )
- pImp->nCur = USHRT_MAX;
+ if( n == pImp->m_nCurrentIndex )
+ pImp->m_nCurrentIndex = USHRT_MAX;
if( !nErr )
nErr = pImp->MakeBlockList();
}
@@ -331,9 +331,9 @@ bool SwTextBlocks::Delete( sal_uInt16 n )
void SwTextBlocks::Rename( sal_uInt16 n, const OUString* s, const OUString* l )
{
- if( pImp && !pImp->bInPutMuchBlocks )
+ if( pImp && !pImp->m_bInPutMuchBlocks )
{
- pImp->nCur = USHRT_MAX;
+ pImp->m_nCurrentIndex = USHRT_MAX;
OUString aNew;
OUString aLong;
if( s )
@@ -356,9 +356,9 @@ void SwTextBlocks::Rename( sal_uInt16 n, const OUString* s, const OUString* l )
nErr = pImp->Rename( n, aNew, aLong );
if( !nErr )
{
- bool bOnlyText = pImp->aNames[ n ]->bIsOnlyText;
- delete pImp->aNames[n];
- pImp->aNames.erase( pImp->aNames.begin() + n );
+ bool bOnlyText = pImp->m_aNames[ n ]->bIsOnlyText;
+ delete pImp->m_aNames[n];
+ pImp->m_aNames.erase( pImp->m_aNames.begin() + n );
pImp->AddName( aNew, aLong, bOnlyText );
nErr = pImp->MakeBlockList();
}
@@ -380,7 +380,7 @@ sal_uLong SwTextBlocks::CopyBlock( SwTextBlocks& rSource, OUString& rSrcShort,
}
if( bIsOld ) //rSource.IsOld() )
nErr = ERR_SWG_OLD_GLOSSARY;
- else if( pImp->bInPutMuchBlocks )
+ else if( pImp->m_bInPutMuchBlocks )
nErr = ERR_SWG_INTERNAL_ERROR;
else
nErr = pImp->CopyBlock(*rSource.pImp, rSrcShort, rLong);
@@ -389,7 +389,7 @@ sal_uLong SwTextBlocks::CopyBlock( SwTextBlocks& rSource, OUString& rSrcShort,
bool SwTextBlocks::BeginGetDoc( sal_uInt16 n )
{
- if( pImp && !pImp->bInPutMuchBlocks )
+ if( pImp && !pImp->m_bInPutMuchBlocks )
{
if( pImp->IsFileChanged() )
nErr = ERR_TXTBLOCK_NEWFILE_ERROR;
@@ -398,9 +398,9 @@ bool SwTextBlocks::BeginGetDoc( sal_uInt16 n )
pImp->ClearDoc();
nErr = pImp->GetDoc( n );
if( nErr )
- pImp->nCur = USHRT_MAX;
+ pImp->m_nCurrentIndex = USHRT_MAX;
else
- pImp->nCur = n;
+ pImp->m_nCurrentIndex = n;
}
return ( nErr == 0 );
}
@@ -409,7 +409,7 @@ bool SwTextBlocks::BeginGetDoc( sal_uInt16 n )
void SwTextBlocks::EndGetDoc()
{
- if( pImp && !pImp->bInPutMuchBlocks )
+ if( pImp && !pImp->m_bInPutMuchBlocks )
pImp->CloseFile();
}
@@ -417,7 +417,7 @@ bool SwTextBlocks::BeginPutDoc( const OUString& s, const OUString& l )
{
if( pImp )
{
- bool bOk = pImp->bInPutMuchBlocks;
+ bool bOk = pImp->m_bInPutMuchBlocks;
if( !bOk )
{
if( pImp->IsFileChanged() )
@@ -445,23 +445,23 @@ sal_uInt16 SwTextBlocks::PutDoc()
nErr = pImp->PutDoc();
if( !nErr )
{
- pImp->nCur = GetIndex( pImp->aShort );
- if( pImp->nCur != USHRT_MAX )
- pImp->aNames[ pImp->nCur ]->aLong = pImp->aLong;
+ pImp->m_nCurrentIndex = GetIndex( pImp->m_aShort );
+ if( pImp->m_nCurrentIndex != USHRT_MAX )
+ pImp->m_aNames[ pImp->m_nCurrentIndex ]->aLong = pImp->m_aLong;
else
{
- pImp->AddName( pImp->aShort, pImp->aLong );
- pImp->nCur = pImp->GetIndex( pImp->aShort );
+ pImp->AddName( pImp->m_aShort, pImp->m_aLong );
+ pImp->m_nCurrentIndex = pImp->GetIndex( pImp->m_aShort );
}
- if( !pImp->bInPutMuchBlocks )
+ if( !pImp->m_bInPutMuchBlocks )
nErr = pImp->MakeBlockList();
}
- if( !pImp->bInPutMuchBlocks )
+ if( !pImp->m_bInPutMuchBlocks )
{
pImp->CloseFile();
pImp->Touch();
}
- nIdx = pImp->nCur;
+ nIdx = pImp->m_nCurrentIndex;
}
return nIdx;
}
@@ -472,7 +472,7 @@ sal_uInt16 SwTextBlocks::PutText( const OUString& rShort, const OUString& rName,
sal_uInt16 nIdx = USHRT_MAX;
if( pImp )
{
- bool bOk = pImp->bInPutMuchBlocks;
+ bool bOk = pImp->m_bInPutMuchBlocks;
if( !bOk )
{
if( pImp->IsFileChanged() )
@@ -485,22 +485,22 @@ sal_uInt16 SwTextBlocks::PutText( const OUString& rShort, const OUString& rName,
{
OUString aNew = GetAppCharClass().uppercase( rShort );
nErr = pImp->PutText( aNew, rName, rText );
- pImp->nCur = USHRT_MAX;
+ pImp->m_nCurrentIndex = USHRT_MAX;
if( !nErr )
{
- nIdx = GetIndex( pImp->aShort );
+ nIdx = GetIndex( pImp->m_aShort );
if( nIdx != USHRT_MAX )
- pImp->aNames[ nIdx ]->aLong = rName;
+ pImp->m_aNames[ nIdx ]->aLong = rName;
else
{
- pImp->AddName( pImp->aShort, rName, true );
- nIdx = pImp->GetIndex( pImp->aShort );
+ pImp->AddName( pImp->m_aShort, rName, true );
+ nIdx = pImp->GetIndex( pImp->m_aShort );
}
- if( !pImp->bInPutMuchBlocks )
+ if( !pImp->m_bInPutMuchBlocks )
nErr = pImp->MakeBlockList();
}
}
- if( !pImp->bInPutMuchBlocks )
+ if( !pImp->m_bInPutMuchBlocks )
{
pImp->CloseFile();
pImp->Touch();
@@ -512,7 +512,7 @@ sal_uInt16 SwTextBlocks::PutText( const OUString& rShort, const OUString& rName,
SwDoc* SwTextBlocks::GetDoc()
{
if( pImp )
- return pImp->pDoc;
+ return pImp->m_pDoc;
return nullptr;
}
@@ -521,7 +521,7 @@ void SwTextBlocks::ClearDoc()
if( pImp )
{
pImp->ClearDoc();
- pImp->nCur = USHRT_MAX;
+ pImp->m_nCurrentIndex = USHRT_MAX;
}
}
@@ -532,15 +532,15 @@ OUString SwTextBlocks::GetFileName() const
bool SwTextBlocks::IsReadOnly() const
{
- return pImp->bReadOnly;
+ return pImp->m_bReadOnly;
}
bool SwTextBlocks::IsOnlyTextBlock( sal_uInt16 nIdx ) const
{
bool bRet = false;
- if( pImp && !pImp->bInPutMuchBlocks )
+ if( pImp && !pImp->m_bInPutMuchBlocks )
{
- SwBlockName* pBlkNm = pImp->aNames[ nIdx ];
+ SwBlockName* pBlkNm = pImp->m_aNames[ nIdx ];
if( !pBlkNm->bIsOnlyTextFlagInit &&
!pImp->IsFileChanged() && !pImp->OpenFile() )
{
@@ -558,8 +558,8 @@ bool SwTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const
sal_uInt16 nIdx = pImp->GetIndex( rShort );
if( USHRT_MAX != nIdx )
{
- if( pImp->aNames[ nIdx ]->bIsOnlyTextFlagInit )
- return pImp->aNames[ nIdx ]->bIsOnlyText;
+ if( pImp->m_aNames[ nIdx ]->bIsOnlyTextFlagInit )
+ return pImp->m_aNames[ nIdx ]->bIsOnlyText;
return IsOnlyTextBlock( nIdx );
}
@@ -570,7 +570,7 @@ bool SwTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const
bool SwTextBlocks::GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTable )
{
bool bRet = true;
- if ( pImp && !pImp->bInPutMuchBlocks )
+ if ( pImp && !pImp->m_bInPutMuchBlocks )
bRet = ( 0 == pImp->GetMacroTable( nIdx, rMacroTable ) );
return bRet;
}
@@ -578,7 +578,7 @@ bool SwTextBlocks::GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTabl
bool SwTextBlocks::SetMacroTable( sal_uInt16 nIdx, const SvxMacroTableDtor& rMacroTable )
{
bool bRet = true;
- if ( pImp && !pImp->bInPutMuchBlocks )
+ if ( pImp && !pImp->m_bInPutMuchBlocks )
bRet = ( 0 == pImp->SetMacroTable( nIdx, rMacroTable ) );
return bRet;
}
More information about the Libreoffice-commits
mailing list