diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-12-07 09:11:18 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-12-07 10:56:50 +0100 |
commit | 28fb1e99223d2ea934f7f7f85226238b6365d024 (patch) | |
tree | 134758c179367b9726c4b5b16fd234f990937654 /sw | |
parent | 4aa6262f2544d0f2bf8f24561db53450d78c9e78 (diff) |
sw: prefix members of SwBlockName, SwTaggedPDFHelper, ...
... SwXMLBlockListExport and SwXMLTextBlocks
See tdf#94879 for motivation.
Change-Id: Ifdaad455e60254f730d95ff91bc4c78b5f61bc7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107331
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/EnhancedPDFExportHelper.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/inc/SwXMLBlockExport.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/SwXMLTextBlocks.hxx | 12 | ||||
-rw-r--r-- | sw/source/core/inc/swblocks.hxx | 14 | ||||
-rw-r--r-- | sw/source/core/swg/SwXMLBlockExport.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/swg/SwXMLTextBlocks.cxx | 112 | ||||
-rw-r--r-- | sw/source/core/swg/SwXMLTextBlocks1.cxx | 80 | ||||
-rw-r--r-- | sw/source/core/swg/swblocks.cxx | 52 | ||||
-rw-r--r-- | sw/source/core/text/EnhancedPDFExportHelper.cxx | 18 |
9 files changed, 154 insertions, 154 deletions
diff --git a/sw/inc/EnhancedPDFExportHelper.hxx b/sw/inc/EnhancedPDFExportHelper.hxx index 516edd30c799..bda578f8b17e 100644 --- a/sw/inc/EnhancedPDFExportHelper.hxx +++ b/sw/inc/EnhancedPDFExportHelper.hxx @@ -131,11 +131,11 @@ class SwTaggedPDFHelper // This will be incremented for each BeginTag() call. // It denotes the number of tags to close during EndStructureElements(); - sal_uInt8 nEndStructureElement; + sal_uInt8 m_nEndStructureElement; // If an already existing tag is reopened for follows of flow frames, // this value stores the tag id which has to be restored. - sal_Int32 nRestoreCurrentTag; + sal_Int32 m_nRestoreCurrentTag; vcl::PDFExtOutDevData* mpPDFExtOutDevData; diff --git a/sw/source/core/inc/SwXMLBlockExport.hxx b/sw/source/core/inc/SwXMLBlockExport.hxx index e34b2b3cbbbc..03e7c9dc5933 100644 --- a/sw/source/core/inc/SwXMLBlockExport.hxx +++ b/sw/source/core/inc/SwXMLBlockExport.hxx @@ -26,7 +26,7 @@ class SwXMLTextBlocks; class SwXMLBlockListExport : public SvXMLExport { private: - SwXMLTextBlocks &rBlockList; + SwXMLTextBlocks &m_rBlockList; public: SwXMLBlockListExport( diff --git a/sw/source/core/inc/SwXMLTextBlocks.hxx b/sw/source/core/inc/SwXMLTextBlocks.hxx index 8d30fb588d0d..17a6a5aa3869 100644 --- a/sw/source/core/inc/SwXMLTextBlocks.hxx +++ b/sw/source/core/inc/SwXMLTextBlocks.hxx @@ -36,10 +36,10 @@ namespace o3tl { class SwXMLTextBlocks final : public SwImpBlocks { - SfxObjectShellRef xDocShellRef; - SwXmlFlags nFlags; - OUString aPackageName; - tools::SvRef<SfxMedium> xMedium; + SfxObjectShellRef m_xDocShellRef; + SwXmlFlags m_nFlags; + OUString m_aPackageName; + tools::SvRef<SfxMedium> m_xMedium; void ReadInfo(); void WriteInfo(); @@ -47,8 +47,8 @@ class SwXMLTextBlocks final : public SwImpBlocks void ResetBlockMode(); public: - css::uno::Reference < css::embed::XStorage > xBlkRoot; - css::uno::Reference < css::embed::XStorage > xRoot; + css::uno::Reference < css::embed::XStorage > m_xBlkRoot; + css::uno::Reference < css::embed::XStorage > m_xRoot; SwXMLTextBlocks( const OUString& rFile ); SwXMLTextBlocks( const css::uno::Reference < css::embed::XStorage >&, const OUString& rFile ); void AddName( const OUString&, const OUString&, const OUString&, bool bOnlyText ); diff --git a/sw/source/core/inc/swblocks.hxx b/sw/source/core/inc/swblocks.hxx index 3cc65c48439a..31f70945718b 100644 --- a/sw/source/core/inc/swblocks.hxx +++ b/sw/source/core/inc/swblocks.hxx @@ -34,19 +34,19 @@ class SvxMacroTableDtor; class SwBlockName { friend class SwImpBlocks; - sal_uInt16 nHashS, nHashL; // Hash codes for testing + sal_uInt16 m_nHashS, m_nHashL; // Hash codes for testing public: - OUString aShort; /// Shortname - OUString aLong; /// Longname - OUString aPackageName; /// Package name - bool bIsOnlyTextFlagInit : 1; /// Is the Flag valid? - bool bIsOnlyText : 1; /// Unformatted text + OUString m_aShort; /// Shortname + OUString m_aLong; /// Longname + OUString m_aPackageName; /// Package name + bool m_bIsOnlyTextFlagInit : 1; /// Is the Flag valid? + bool m_bIsOnlyText : 1; /// Unformatted text SwBlockName( const OUString& rShort, const OUString& rLong ); SwBlockName( const OUString& rShort, const OUString& rLong, const OUString& rPackageName ); /// For sorting in the array - bool operator< ( const SwBlockName& r ) const { return aShort < r.aShort; } + bool operator< ( const SwBlockName& r ) const { return m_aShort < r.m_aShort; } }; class SwBlockNames : public o3tl::sorted_vector<std::unique_ptr<SwBlockName>, o3tl::less_uniqueptr_to<SwBlockName> > {}; diff --git a/sw/source/core/swg/SwXMLBlockExport.cxx b/sw/source/core/swg/SwXMLBlockExport.cxx index 970e655e22d1..19ba63eaeac7 100644 --- a/sw/source/core/swg/SwXMLBlockExport.cxx +++ b/sw/source/core/swg/SwXMLBlockExport.cxx @@ -33,7 +33,7 @@ SwXMLBlockListExport::SwXMLBlockListExport( const OUString &rFileName, uno::Reference< xml::sax::XDocumentHandler> const &rHandler) : SvXMLExport( rContext, "", rFileName, util::MeasureUnit::CM, rHandler ), - rBlockList(rBlocks) + m_rBlockList(rBlocks) { GetNamespaceMap_().Add( GetXMLToken ( XML_NP_BLOCK_LIST ), GetXMLToken ( XML_N_BLOCK_LIST ), @@ -51,24 +51,24 @@ ErrCode SwXMLBlockListExport::exportDoc(enum XMLTokenEnum ) GetNamespaceMap_().GetNameByKey ( XML_NAMESPACE_BLOCKLIST ) ); AddAttribute( XML_NAMESPACE_BLOCKLIST, XML_LIST_NAME, - rBlockList.GetName()); + m_rBlockList.GetName()); { SvXMLElementExport aRoot (*this, XML_NAMESPACE_BLOCKLIST, XML_BLOCK_LIST, true, true); - sal_uInt16 nBlocks= rBlockList.GetCount(); + sal_uInt16 nBlocks= m_rBlockList.GetCount(); for ( sal_uInt16 i = 0; i < nBlocks; i++) { AddAttribute( XML_NAMESPACE_BLOCKLIST, XML_ABBREVIATED_NAME, - rBlockList.GetShortName(i)); + m_rBlockList.GetShortName(i)); AddAttribute( XML_NAMESPACE_BLOCKLIST, XML_PACKAGE_NAME, - rBlockList.GetPackageName(i)); + m_rBlockList.GetPackageName(i)); AddAttribute( XML_NAMESPACE_BLOCKLIST, XML_NAME, - rBlockList.GetLongName(i)); + m_rBlockList.GetLongName(i)); AddAttribute( XML_NAMESPACE_BLOCKLIST, XML_UNFORMATTED_TEXT, - rBlockList.IsOnlyTextBlock(i) ? XML_TRUE : XML_FALSE ); + m_rBlockList.IsOnlyTextBlock(i) ? XML_TRUE : XML_FALSE ); SvXMLElementExport aBlock( *this, XML_NAMESPACE_BLOCKLIST, XML_BLOCK, true, true); } diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index cb0b337acf06..e5b95c13d091 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -49,26 +49,26 @@ using namespace ::com::sun::star; void SwXMLTextBlocks::InitBlockMode ( const uno::Reference < embed::XStorage >& rStorage ) { - xBlkRoot = rStorage; - xRoot = nullptr; + m_xBlkRoot = rStorage; + m_xRoot = nullptr; } void SwXMLTextBlocks::ResetBlockMode ( ) { - xBlkRoot = nullptr; - xRoot = nullptr; + m_xBlkRoot = nullptr; + m_xRoot = nullptr; } SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile ) : SwImpBlocks(rFile) - , nFlags(SwXmlFlags::NONE) + , m_nFlags(SwXmlFlags::NONE) { SwDocShell* pDocSh = new SwDocShell ( SfxObjectCreateMode::INTERNAL ); if( !pDocSh->DoInitNew() ) return; m_bReadOnly = true; m_xDoc = pDocSh->GetDoc(); - xDocShellRef = pDocSh; + m_xDocShellRef = pDocSh; m_xDoc->SetOle2Link( Link<bool,void>() ); m_xDoc->GetIDocumentUndoRedo().DoUndo(false); uno::Reference< embed::XStorage > refStg; @@ -103,14 +103,14 @@ SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile ) SwXMLTextBlocks::SwXMLTextBlocks( const uno::Reference < embed::XStorage >& rStg, const OUString& rName ) : SwImpBlocks( rName ) - , nFlags(SwXmlFlags::NONE) + , m_nFlags(SwXmlFlags::NONE) { SwDocShell* pDocSh = new SwDocShell ( SfxObjectCreateMode::INTERNAL ); if( !pDocSh->DoInitNew() ) return; m_bReadOnly = false; m_xDoc = pDocSh->GetDoc(); - xDocShellRef = pDocSh; + m_xDocShellRef = pDocSh; m_xDoc->SetOle2Link( Link<bool,void>() ); m_xDoc->GetIDocumentUndoRedo().DoUndo(false); @@ -124,9 +124,9 @@ SwXMLTextBlocks::~SwXMLTextBlocks() if ( m_bInfoChanged ) WriteInfo(); ResetBlockMode (); - if(xDocShellRef.is()) - xDocShellRef->DoClose(); - xDocShellRef = nullptr; + if(m_xDocShellRef.is()) + m_xDocShellRef->DoClose(); + m_xDocShellRef = nullptr; } void SwXMLTextBlocks::ClearDoc() @@ -141,8 +141,8 @@ void SwXMLTextBlocks::ClearDoc() void SwXMLTextBlocks::AddName( const OUString& rShort, const OUString& rLong, bool bOnlyText ) { - aPackageName = GeneratePackageName( rShort ); - AddName(rShort, rLong, aPackageName, bOnlyText); + m_aPackageName = GeneratePackageName( rShort ); + AddName(rShort, rLong, m_aPackageName, bOnlyText); } void SwXMLTextBlocks::AddName( const OUString& rShort, const OUString& rLong, @@ -154,22 +154,22 @@ void SwXMLTextBlocks::AddName( const OUString& rShort, const OUString& rLong, m_aNames.erase( m_aNames.begin() + nIdx ); } std::unique_ptr<SwBlockName> pNew(new SwBlockName( rShort, rLong, rPackageName )); - pNew->bIsOnlyTextFlagInit = true; - pNew->bIsOnlyText = bOnlyText; + pNew->m_bIsOnlyTextFlagInit = true; + pNew->m_bIsOnlyText = bOnlyText; m_aNames.insert( std::move(pNew) ); m_bInfoChanged = true; } ErrCode SwXMLTextBlocks::Delete( sal_uInt16 n ) { - const OUString aPckName (m_aNames[n]->aPackageName); - if ( xBlkRoot.is() && - xBlkRoot->hasByName( aPckName ) && xBlkRoot->isStreamElement( aPckName ) ) + const OUString aPckName (m_aNames[n]->m_aPackageName); + if ( m_xBlkRoot.is() && + m_xBlkRoot->hasByName( aPckName ) && m_xBlkRoot->isStreamElement( aPckName ) ) { try { - xBlkRoot->removeElement ( aPckName ); - uno::Reference < embed::XTransactedObject > xTrans( xBlkRoot, uno::UNO_QUERY ); + m_xBlkRoot->removeElement ( aPckName ); + uno::Reference < embed::XTransactedObject > xTrans( m_xBlkRoot, uno::UNO_QUERY ); if ( xTrans.is() ) xTrans->commit(); return ERRCODE_NONE; @@ -184,46 +184,46 @@ ErrCode SwXMLTextBlocks::Delete( sal_uInt16 n ) ErrCode SwXMLTextBlocks::Rename( sal_uInt16 nIdx, const OUString& rNewShort ) { - OSL_ENSURE( xBlkRoot.is(), "No storage set" ); - if(!xBlkRoot.is()) + OSL_ENSURE( m_xBlkRoot.is(), "No storage set" ); + if(!m_xBlkRoot.is()) return ERRCODE_NONE; - OUString aOldName (m_aNames[nIdx]->aPackageName); + OUString aOldName (m_aNames[nIdx]->m_aPackageName); m_aShort = rNewShort; - aPackageName = GeneratePackageName( m_aShort ); + m_aPackageName = GeneratePackageName( m_aShort ); - if(aOldName != aPackageName) + if(aOldName != m_aPackageName) { if (IsOnlyTextBlock ( nIdx ) ) { OUString sExt(".xml"); OUString aOldStreamName = aOldName + sExt; - OUString aNewStreamName = aPackageName + sExt; + OUString aNewStreamName = m_aPackageName + sExt; - xRoot = xBlkRoot->openStorageElement( aOldName, embed::ElementModes::READWRITE ); + m_xRoot = m_xBlkRoot->openStorageElement( aOldName, embed::ElementModes::READWRITE ); try { - xRoot->renameElement ( aOldStreamName, aNewStreamName ); + m_xRoot->renameElement ( aOldStreamName, aNewStreamName ); } catch(const container::ElementExistException&) { SAL_WARN("sw", "Couldn't rename " << aOldStreamName << " to " << aNewStreamName); } - uno::Reference < embed::XTransactedObject > xTrans( xRoot, uno::UNO_QUERY ); + uno::Reference < embed::XTransactedObject > xTrans( m_xRoot, uno::UNO_QUERY ); if ( xTrans.is() ) xTrans->commit(); - xRoot = nullptr; + m_xRoot = nullptr; } try { - xBlkRoot->renameElement ( aOldName, aPackageName ); + m_xBlkRoot->renameElement ( aOldName, m_aPackageName ); } catch(const container::ElementExistException&) { - SAL_WARN("sw", "Couldn't rename " << aOldName << " to " << aPackageName); + SAL_WARN("sw", "Couldn't rename " << aOldName << " to " << m_aPackageName); } } - uno::Reference < embed::XTransactedObject > xTrans( xBlkRoot, uno::UNO_QUERY ); + uno::Reference < embed::XTransactedObject > xTrans( m_xBlkRoot, uno::UNO_QUERY ); if ( xTrans.is() ) xTrans->commit(); // No need to commit xBlkRoot here as SwTextBlocks::Rename calls @@ -233,15 +233,15 @@ ErrCode SwXMLTextBlocks::Rename( sal_uInt16 nIdx, const OUString& rNewShort ) ErrCode SwXMLTextBlocks::StartPutBlock( const OUString& rShort, const OUString& rPackageName ) { - OSL_ENSURE( xBlkRoot.is(), "No storage set" ); - if(!xBlkRoot.is()) + OSL_ENSURE( m_xBlkRoot.is(), "No storage set" ); + if(!m_xBlkRoot.is()) return ERRCODE_NONE; GetIndex ( rShort ); try { - xRoot = xBlkRoot->openStorageElement( rPackageName, embed::ElementModes::READWRITE ); + m_xRoot = m_xBlkRoot->openStorageElement( rPackageName, embed::ElementModes::READWRITE ); - uno::Reference< beans::XPropertySet > xRootProps( xRoot, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xRootProps( m_xRoot, uno::UNO_QUERY_THROW ); OUString aMime( SotExchange::GetFormatMimeType( SotClipboardFormatId::STARWRITER_8 ) ); xRootProps->setPropertyValue( "MediaType", uno::makeAny( aMime ) ); } @@ -256,19 +256,19 @@ ErrCode SwXMLTextBlocks::BeginPutDoc( const OUString& rShort, const OUString& rL // Store in base class m_aShort = rShort; m_aLong = rLong; - aPackageName = GeneratePackageName( rShort ); + m_aPackageName = GeneratePackageName( rShort ); SetIsTextOnly( rShort, false); - return StartPutBlock (rShort, aPackageName); + return StartPutBlock (rShort, m_aPackageName); } ErrCode SwXMLTextBlocks::PutBlock() { ErrCode nRes = ERRCODE_NONE; // dead variable, this always returns 0 - SwXmlFlags nCommitFlags = nFlags; + SwXmlFlags nCommitFlags = m_nFlags; WriterRef xWrt; ::GetXMLWriter ( OUString(), GetBaseURL(), xWrt); - SwWriter aWriter (xRoot, *m_xDoc ); + SwWriter aWriter (m_xRoot, *m_xDoc ); xWrt->m_bBlock = true; nRes = aWriter.Write ( xWrt ); @@ -284,7 +284,7 @@ ErrCode SwXMLTextBlocks::PutBlock() // called without optimization bool bOK = false; - if ( xRoot.is() ) + if ( m_xRoot.is() ) { std::unique_ptr<SfxMedium> pTmpMedium; try @@ -292,7 +292,7 @@ ErrCode SwXMLTextBlocks::PutBlock() uno::Reference< embed::XStorage > xTempStorage = ::comphelper::OStorageHelper::GetTemporaryStorage(); - xRoot->copyToStorage( xTempStorage ); + m_xRoot->copyToStorage( xTempStorage ); // TODO/LATER: no progress bar?! // TODO/MBA: strange construct @@ -301,7 +301,7 @@ ErrCode SwXMLTextBlocks::PutBlock() if( bTmpOK ) bTmpOK = pDocSh->SaveCompletedChildren(); - xTempStorage->copyToStorage( xRoot ); + xTempStorage->copyToStorage( m_xRoot ); bOK = bTmpOK; } catch(const uno::Exception&) @@ -315,13 +315,13 @@ ErrCode SwXMLTextBlocks::PutBlock() try { - uno::Reference < embed::XTransactedObject > xTrans( xRoot, uno::UNO_QUERY ); + uno::Reference < embed::XTransactedObject > xTrans( m_xRoot, uno::UNO_QUERY ); if ( xTrans.is() ) xTrans->commit(); - xRoot = nullptr; + m_xRoot = nullptr; if ( nCommitFlags == SwXmlFlags::NONE ) { - uno::Reference < embed::XTransactedObject > xTmpTrans( xBlkRoot, uno::UNO_QUERY ); + uno::Reference < embed::XTransactedObject > xTmpTrans( m_xBlkRoot, uno::UNO_QUERY ); if ( xTmpTrans.is() ) xTmpTrans->commit(); } @@ -366,19 +366,19 @@ bool SwXMLTextBlocks::PutMuchEntries( bool bOn ) bRet = ERRCODE_NONE == OpenFile( false ); if( bRet ) { - nFlags |= SwXmlFlags::NoRootCommit; + m_nFlags |= SwXmlFlags::NoRootCommit; m_bInPutMuchBlocks = true; } } } else if( m_bInPutMuchBlocks ) { - nFlags &= ~SwXmlFlags::NoRootCommit; - if( xBlkRoot.is() ) + m_nFlags &= ~SwXmlFlags::NoRootCommit; + if( m_xBlkRoot.is() ) { try { - uno::Reference < embed::XTransactedObject > xTrans( xBlkRoot, uno::UNO_QUERY ); + uno::Reference < embed::XTransactedObject > xTrans( m_xBlkRoot, uno::UNO_QUERY ); if ( xTrans.is() ) xTrans->commit(); MakeBlockList(); @@ -424,7 +424,7 @@ void SwXMLTextBlocks::SetIsTextOnly( const OUString& rShort, bool bNewValue ) { sal_uInt16 nIdx = GetIndex ( rShort ); if (nIdx != USHRT_MAX) - m_aNames[nIdx]->bIsOnlyText = bNewValue; + m_aNames[nIdx]->m_bIsOnlyText = bNewValue; } bool SwXMLTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const @@ -433,13 +433,13 @@ bool SwXMLTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const bool bRet = false; if (nIdx != USHRT_MAX) { - bRet = m_aNames[nIdx]->bIsOnlyText; + bRet = m_aNames[nIdx]->m_bIsOnlyText; } return bRet; } bool SwXMLTextBlocks::IsOnlyTextBlock( sal_uInt16 nIdx ) const { - return m_aNames[nIdx]->bIsOnlyText; + return m_aNames[nIdx]->m_bIsOnlyText; } bool SwXMLTextBlocks::IsFileUCBStorage( const OUString & rFileName) @@ -490,9 +490,9 @@ ErrCode SwXMLTextBlocks::PutText( const OUString& rShort, const OUString& rName, m_aLong = rName; m_aCurrentText = rText; SetIsTextOnly( m_aShort, true ); - aPackageName = GeneratePackageName( rShort ); + m_aPackageName = GeneratePackageName( rShort ); ClearDoc(); - nRes = PutBlockText( rShort, rText, aPackageName ); + nRes = PutBlockText( rShort, rText, m_aPackageName ); return nRes; } diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx index b76f7ee93f5b..638ecb60c7ce 100644 --- a/sw/source/core/swg/SwXMLTextBlocks1.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx @@ -64,22 +64,22 @@ ErrCode SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx ) { try { - xRoot = xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ ); - xMedium = new SfxMedium( xRoot, GetBaseURL(), "writer8" ); - SwReader aReader( *xMedium, aFolderName, m_xDoc.get() ); + m_xRoot = m_xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ ); + m_xMedium = new SfxMedium( m_xRoot, GetBaseURL(), "writer8" ); + SwReader aReader( *m_xMedium, aFolderName, m_xDoc.get() ); ReadXML->SetBlockMode( true ); aReader.Read( *ReadXML ); ReadXML->SetBlockMode( false ); // Ole objects fail to display when inserted into the document, as // the ObjectReplacement folder and contents are missing OUString sObjReplacements( "ObjectReplacements" ); - if ( xRoot->hasByName( sObjReplacements ) ) + if ( m_xRoot->hasByName( sObjReplacements ) ) { uno::Reference< document::XStorageBasedDocument > xDocStor( m_xDoc->GetDocShell()->GetModel(), uno::UNO_QUERY_THROW ); uno::Reference< embed::XStorage > xStr( xDocStor->getDocumentStorage() ); if ( xStr.is() ) { - xRoot->copyElementTo( sObjReplacements, xStr, sObjReplacements ); + m_xRoot->copyElementTo( sObjReplacements, xStr, sObjReplacements ); uno::Reference< embed::XTransactedObject > xTrans( xStr, uno::UNO_QUERY ); if ( xTrans.is() ) xTrans->commit(); @@ -90,21 +90,21 @@ ErrCode SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx ) { } - xRoot = nullptr; + m_xRoot = nullptr; } else { OUString aStreamName = aFolderName + ".xml"; try { - xRoot = xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ ); - uno::Reference < io::XStream > xStream = xRoot->openStreamElement( aStreamName, embed::ElementModes::READ ); + m_xRoot = m_xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ ); + uno::Reference < io::XStream > xStream = m_xRoot->openStreamElement( aStreamName, embed::ElementModes::READ ); uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); xml::sax::InputSource aParserInput; - aParserInput.sSystemId = m_aNames[nIdx]->aPackageName; + aParserInput.sSystemId = m_aNames[nIdx]->m_aPackageName; aParserInput.aInputStream = xStream->getInputStream(); @@ -145,7 +145,7 @@ ErrCode SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx ) { } - xRoot = nullptr; + m_xRoot = nullptr; } return ERRCODE_NONE; } @@ -163,9 +163,9 @@ ErrCode SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTable ) { // set current auto text - m_aShort = m_aNames[nIdx]->aShort; - m_aLong = m_aNames[nIdx]->aLong; - aPackageName = m_aNames[nIdx]->aPackageName; + m_aShort = m_aNames[nIdx]->m_aShort; + m_aLong = m_aNames[nIdx]->m_aLong; + m_aPackageName = m_aNames[nIdx]->m_aPackageName; // open stream in proper sub-storage CloseFile(); @@ -174,10 +174,10 @@ ErrCode SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx, try { - xRoot = xBlkRoot->openStorageElement( aPackageName, embed::ElementModes::READ ); - bool bOasis = SotStorage::GetVersion( xRoot ) > SOFFICE_FILEFORMAT_60; + m_xRoot = m_xBlkRoot->openStorageElement( m_aPackageName, embed::ElementModes::READ ); + bool bOasis = SotStorage::GetVersion( m_xRoot ) > SOFFICE_FILEFORMAT_60; - uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement( + uno::Reference < io::XStream > xDocStream = m_xRoot->openStreamElement( "atevent.xml", embed::ElementModes::READ ); OSL_ENSURE(xDocStream.is(), "Can't create stream"); if ( !xDocStream.is() ) @@ -256,14 +256,14 @@ ErrCode SwXMLTextBlocks::GetBlockText( const OUString& rShort, OUString& rText ) { bool bTextOnly = true; - xRoot = xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ ); - if ( !xRoot->hasByName( aStreamName ) || !xRoot->isStreamElement( aStreamName ) ) + m_xRoot = m_xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ ); + if ( !m_xRoot->hasByName( aStreamName ) || !m_xRoot->isStreamElement( aStreamName ) ) { bTextOnly = false; aStreamName = "content.xml"; } - uno::Reference < io::XStream > xContents = xRoot->openStreamElement( aStreamName, embed::ElementModes::READ ); + uno::Reference < io::XStream > xContents = m_xRoot->openStreamElement( aStreamName, embed::ElementModes::READ ); uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); @@ -301,7 +301,7 @@ ErrCode SwXMLTextBlocks::GetBlockText( const OUString& rShort, OUString& rText ) // re throw ? } - xRoot = nullptr; + m_xRoot = nullptr; } catch ( uno::Exception& ) { @@ -332,8 +332,8 @@ ErrCode SwXMLTextBlocks::PutBlockText( const OUString& rShort, try { - xRoot = xBlkRoot->openStorageElement( rPackageName, embed::ElementModes::WRITE ); - uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement( aStreamName, + m_xRoot = m_xBlkRoot->openStorageElement( rPackageName, embed::ElementModes::WRITE ); + uno::Reference < io::XStream > xDocStream = m_xRoot->openStreamElement( aStreamName, embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ); uno::Reference < beans::XPropertySet > xSet( xDocStream, uno::UNO_QUERY ); @@ -345,13 +345,13 @@ ErrCode SwXMLTextBlocks::PutBlockText( const OUString& rShort, xExp->exportDoc( rText ); - uno::Reference < embed::XTransactedObject > xTrans( xRoot, uno::UNO_QUERY ); + uno::Reference < embed::XTransactedObject > xTrans( m_xRoot, uno::UNO_QUERY ); if ( xTrans.is() ) xTrans->commit(); - if (! (nFlags & SwXmlFlags::NoRootCommit) ) + if (! (m_nFlags & SwXmlFlags::NoRootCommit) ) { - uno::Reference < embed::XTransactedObject > xTmpTrans( xBlkRoot, uno::UNO_QUERY ); + uno::Reference < embed::XTransactedObject > xTmpTrans( m_xBlkRoot, uno::UNO_QUERY ); if ( xTmpTrans.is() ) xTmpTrans->commit(); } @@ -361,7 +361,7 @@ ErrCode SwXMLTextBlocks::PutBlockText( const OUString& rShort, nRes = ERR_SWG_WRITE_ERROR; } - xRoot = nullptr; + m_xRoot = nullptr; //TODO/LATER: error handling /* @@ -383,7 +383,7 @@ void SwXMLTextBlocks::ReadInfo() const OUString sDocName( XMLN_BLOCKLIST ); try { - if ( !xBlkRoot.is() || !xBlkRoot->hasByName( sDocName ) || !xBlkRoot->isStreamElement( sDocName ) ) + if ( !m_xBlkRoot.is() || !m_xBlkRoot->hasByName( sDocName ) || !m_xBlkRoot->isStreamElement( sDocName ) ) return; uno::Reference< uno::XComponentContext > xContext = @@ -392,7 +392,7 @@ void SwXMLTextBlocks::ReadInfo() xml::sax::InputSource aParserInput; aParserInput.sSystemId = sDocName; - uno::Reference < io::XStream > xDocStream = xBlkRoot->openStreamElement( sDocName, embed::ElementModes::READ ); + uno::Reference < io::XStream > xDocStream = m_xBlkRoot->openStreamElement( sDocName, embed::ElementModes::READ ); aParserInput.aInputStream = xDocStream->getInputStream(); // get filter @@ -416,7 +416,7 @@ void SwXMLTextBlocks::ReadInfo() } void SwXMLTextBlocks::WriteInfo() { - if ( !(xBlkRoot.is() || ERRCODE_NONE == OpenFile ( false )) ) + if ( !(m_xBlkRoot.is() || ERRCODE_NONE == OpenFile ( false )) ) return; uno::Reference< uno::XComponentContext > xContext = @@ -434,7 +434,7 @@ void SwXMLTextBlocks::WriteInfo() try { - uno::Reference < io::XStream > xDocStream = xBlkRoot->openStreamElement( XMLN_BLOCKLIST, + uno::Reference < io::XStream > xDocStream = m_xBlkRoot->openStreamElement( XMLN_BLOCKLIST, embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ); uno::Reference < beans::XPropertySet > xSet( xDocStream, uno::UNO_QUERY ); @@ -446,7 +446,7 @@ void SwXMLTextBlocks::WriteInfo() xExp->exportDoc( XML_BLOCK_LIST ); - uno::Reference < embed::XTransactedObject > xTrans( xBlkRoot, uno::UNO_QUERY ); + uno::Reference < embed::XTransactedObject > xTrans( m_xBlkRoot, uno::UNO_QUERY ); if ( xTrans.is() ) xTrans->commit(); } @@ -463,9 +463,9 @@ ErrCode SwXMLTextBlocks::SetMacroTable( const SvxMacroTableDtor& rMacroTable ) { // set current autotext - m_aShort = m_aNames[nIdx]->aShort; - m_aLong = m_aNames[nIdx]->aLong; - aPackageName = m_aNames[nIdx]->aPackageName; + m_aShort = m_aNames[nIdx]->m_aShort; + m_aLong = m_aNames[nIdx]->m_aLong; + m_aPackageName = m_aNames[nIdx]->m_aPackageName; // start XML autotext event export ErrCode nRes = ERRCODE_NONE; @@ -488,10 +488,10 @@ ErrCode SwXMLTextBlocks::SetMacroTable( { try { - xRoot = xBlkRoot->openStorageElement( aPackageName, embed::ElementModes::WRITE ); - bool bOasis = SotStorage::GetVersion( xRoot ) > SOFFICE_FILEFORMAT_60; + m_xRoot = m_xBlkRoot->openStorageElement( m_aPackageName, embed::ElementModes::WRITE ); + bool bOasis = SotStorage::GetVersion( m_xRoot ) > SOFFICE_FILEFORMAT_60; - uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement( "atevent.xml", + uno::Reference < io::XStream > xDocStream = m_xRoot->openStreamElement( "atevent.xml", embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ); uno::Reference < beans::XPropertySet > xSet( xDocStream, uno::UNO_QUERY ); @@ -538,15 +538,15 @@ ErrCode SwXMLTextBlocks::SetMacroTable( nRes = ERR_SWG_WRITE_ERROR; // finally, commit stream, sub-storage and storage - uno::Reference < embed::XTransactedObject > xTmpTrans( xRoot, uno::UNO_QUERY ); + uno::Reference < embed::XTransactedObject > xTmpTrans( m_xRoot, uno::UNO_QUERY ); if ( xTmpTrans.is() ) xTmpTrans->commit(); - uno::Reference < embed::XTransactedObject > xTrans( xBlkRoot, uno::UNO_QUERY ); + uno::Reference < embed::XTransactedObject > xTrans( m_xBlkRoot, uno::UNO_QUERY ); if ( xTrans.is() ) xTrans->commit(); - xRoot = nullptr; + m_xRoot = nullptr; } catch ( uno::Exception& ) { diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx index e8ca2b1c7623..eac9494c69fe 100644 --- a/sw/source/core/swg/swblocks.cxx +++ b/sw/source/core/swg/swblocks.cxx @@ -48,19 +48,19 @@ sal_uInt16 SwImpBlocks::Hash( const OUString& r ) } SwBlockName::SwBlockName( const OUString& rShort, const OUString& rLong ) - : aShort( rShort ), aLong( rLong ), aPackageName (rShort), - bIsOnlyTextFlagInit( false ), bIsOnlyText( false ) + : m_aShort( rShort ), m_aLong( rLong ), m_aPackageName (rShort), + m_bIsOnlyTextFlagInit( false ), m_bIsOnlyText( false ) { - nHashS = SwImpBlocks::Hash( rShort ); - nHashL = SwImpBlocks::Hash( rLong ); + m_nHashS = SwImpBlocks::Hash( rShort ); + m_nHashL = SwImpBlocks::Hash( rLong ); } SwBlockName::SwBlockName( const OUString& rShort, const OUString& rLong, const OUString& rPackageName) - : aShort( rShort ), aLong( rLong ), aPackageName (rPackageName), - bIsOnlyTextFlagInit( false ), bIsOnlyText( false ) + : m_aShort( rShort ), m_aLong( rLong ), m_aPackageName (rPackageName), + m_bIsOnlyTextFlagInit( false ), m_bIsOnlyText( false ) { - nHashS = SwImpBlocks::Hash( rShort ); - nHashL = SwImpBlocks::Hash( rLong ); + m_nHashS = SwImpBlocks::Hash( rShort ); + m_nHashL = SwImpBlocks::Hash( rLong ); } /** @@ -131,8 +131,8 @@ sal_uInt16 SwImpBlocks::GetIndex( const OUString& rShort ) const for( size_t i = 0; i < m_aNames.size(); i++ ) { const SwBlockName* pName = m_aNames[ i ].get(); - if( pName->nHashS == nHash - && pName->aShort == s ) + if( pName->m_nHashS == nHash + && pName->m_aShort == s ) return i; } return USHRT_MAX; @@ -144,8 +144,8 @@ sal_uInt16 SwImpBlocks::GetLongIndex( const OUString& rLong ) const for( size_t i = 0; i < m_aNames.size(); i++ ) { const SwBlockName* pName = m_aNames[ i ].get(); - if( pName->nHashL == nHash - && pName->aLong == rLong ) + if( pName->m_nHashL == nHash + && pName->m_aLong == rLong ) return i; } return USHRT_MAX; @@ -154,21 +154,21 @@ sal_uInt16 SwImpBlocks::GetLongIndex( const OUString& rLong ) const OUString SwImpBlocks::GetShortName( sal_uInt16 n ) const { if( n < m_aNames.size() ) - return m_aNames[n]->aShort; + return m_aNames[n]->m_aShort; return OUString(); } OUString SwImpBlocks::GetLongName( sal_uInt16 n ) const { if( n < m_aNames.size() ) - return m_aNames[n]->aLong; + return m_aNames[n]->m_aLong; return OUString(); } OUString SwImpBlocks::GetPackageName( sal_uInt16 n ) const { if( n < m_aNames.size() ) - return m_aNames[n]->aPackageName; + return m_aNames[n]->m_aPackageName; return OUString(); } @@ -181,8 +181,8 @@ void SwImpBlocks::AddName( const OUString& rShort, const OUString& rLong, m_aNames.erase( m_aNames.begin() + nIdx ); } std::unique_ptr<SwBlockName> pNew(new SwBlockName( rShort, rLong )); - pNew->bIsOnlyTextFlagInit = true; - pNew->bIsOnlyText = bOnlyText; + pNew->m_bIsOnlyTextFlagInit = true; + pNew->m_bIsOnlyText = bOnlyText; m_aNames.insert( std::move(pNew) ); } @@ -335,7 +335,7 @@ void SwTextBlocks::Rename( sal_uInt16 n, const OUString* s, const OUString* l ) m_nErr = m_pImp->Rename( n, aNew ); if( !m_nErr ) { - bool bOnlyText = m_pImp->m_aNames[ n ]->bIsOnlyText; + bool bOnlyText = m_pImp->m_aNames[ n ]->m_bIsOnlyText; m_pImp->m_aNames.erase( m_pImp->m_aNames.begin() + n ); m_pImp->AddName( aNew, aLong, bOnlyText ); m_nErr = m_pImp->MakeBlockList(); @@ -405,7 +405,7 @@ sal_uInt16 SwTextBlocks::PutDoc() { m_pImp->m_nCurrentIndex = GetIndex( m_pImp->m_aShort ); if( m_pImp->m_nCurrentIndex != USHRT_MAX ) - m_pImp->m_aNames[ m_pImp->m_nCurrentIndex ]->aLong = m_pImp->m_aLong; + m_pImp->m_aNames[ m_pImp->m_nCurrentIndex ]->m_aLong = m_pImp->m_aLong; else { m_pImp->AddName( m_pImp->m_aShort, m_pImp->m_aLong ); @@ -448,7 +448,7 @@ sal_uInt16 SwTextBlocks::PutText( const OUString& rShort, const OUString& rName, { nIdx = GetIndex( m_pImp->m_aShort ); if( nIdx != USHRT_MAX ) - m_pImp->m_aNames[ nIdx ]->aLong = rName; + m_pImp->m_aNames[ nIdx ]->m_aLong = rName; else { m_pImp->AddName( m_pImp->m_aShort, rName, true ); @@ -499,14 +499,14 @@ bool SwTextBlocks::IsOnlyTextBlock( sal_uInt16 nIdx ) const if( m_pImp && !m_pImp->m_bInPutMuchBlocks ) { SwBlockName* pBlkNm = m_pImp->m_aNames[ nIdx ].get(); - if( !pBlkNm->bIsOnlyTextFlagInit && + if( !pBlkNm->m_bIsOnlyTextFlagInit && !m_pImp->IsFileChanged() && !m_pImp->OpenFile() ) { - pBlkNm->bIsOnlyText = m_pImp->IsOnlyTextBlock( pBlkNm->aShort ); - pBlkNm->bIsOnlyTextFlagInit = true; + pBlkNm->m_bIsOnlyText = m_pImp->IsOnlyTextBlock( pBlkNm->m_aShort ); + pBlkNm->m_bIsOnlyTextFlagInit = true; m_pImp->CloseFile(); } - bRet = pBlkNm->bIsOnlyText; + bRet = pBlkNm->m_bIsOnlyText; } return bRet; } @@ -516,8 +516,8 @@ bool SwTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const sal_uInt16 nIdx = m_pImp->GetIndex( rShort ); if( USHRT_MAX != nIdx ) { - if( m_pImp->m_aNames[ nIdx ]->bIsOnlyTextFlagInit ) - return m_pImp->m_aNames[ nIdx ]->bIsOnlyText; + if( m_pImp->m_aNames[ nIdx ]->m_bIsOnlyTextFlagInit ) + return m_pImp->m_aNames[ nIdx ]->m_bIsOnlyText; return IsOnlyTextBlock( nIdx ); } diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 0360bc35667c..c3a9fd3786c0 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -285,8 +285,8 @@ SwTaggedPDFHelper::SwTaggedPDFHelper( const Num_Info* pNumInfo, const Frame_Info* pFrameInfo, const Por_Info* pPorInfo, OutputDevice const & rOut ) - : nEndStructureElement( 0 ), - nRestoreCurrentTag( -1 ), + : m_nEndStructureElement( 0 ), + m_nRestoreCurrentTag( -1 ), mpNumInfo( pNumInfo ), mpFrameInfo( pFrameInfo ), mpPorInfo( pPorInfo ) @@ -389,7 +389,7 @@ bool SwTaggedPDFHelper::CheckReopenTag() if ( -1 != nReopenTag ) { - nRestoreCurrentTag = mpPDFExtOutDevData->GetCurrentStructureElement(); + m_nRestoreCurrentTag = mpPDFExtOutDevData->GetCurrentStructureElement(); const bool bSuccess = mpPDFExtOutDevData->SetCurrentStructureElement( nReopenTag ); OSL_ENSURE( bSuccess, "Failed to reopen tag" ); @@ -405,9 +405,9 @@ bool SwTaggedPDFHelper::CheckReopenTag() void SwTaggedPDFHelper::CheckRestoreTag() const { - if ( nRestoreCurrentTag != -1 ) + if ( m_nRestoreCurrentTag != -1 ) { - const bool bSuccess = mpPDFExtOutDevData->SetCurrentStructureElement( nRestoreCurrentTag ); + const bool bSuccess = mpPDFExtOutDevData->SetCurrentStructureElement( m_nRestoreCurrentTag ); OSL_ENSURE( bSuccess, "Failed to restore reopened tag" ); #if OSL_DEBUG_LEVEL > 1 @@ -420,7 +420,7 @@ void SwTaggedPDFHelper::BeginTag( vcl::PDFWriter::StructElement eType, const OUS { // write new tag const sal_Int32 nId = mpPDFExtOutDevData->BeginStructureElement( eType, rString ); - ++nEndStructureElement; + ++m_nEndStructureElement; #if OSL_DEBUG_LEVEL > 1 aStructStack.push_back( static_cast<sal_uInt16>(eType) ); @@ -930,7 +930,7 @@ void SwTaggedPDFHelper::BeginNumberedListStructureElements() if ( -1 != nReopenTag ) { - nRestoreCurrentTag = mpPDFExtOutDevData->GetCurrentStructureElement(); + m_nRestoreCurrentTag = mpPDFExtOutDevData->GetCurrentStructureElement(); mpPDFExtOutDevData->SetCurrentStructureElement( nReopenTag ); #if OSL_DEBUG_LEVEL > 1 @@ -1301,10 +1301,10 @@ void SwTaggedPDFHelper::BeginBlockStructureElements() void SwTaggedPDFHelper::EndStructureElements() { - while ( nEndStructureElement > 0 ) + while ( m_nEndStructureElement > 0 ) { EndTag(); - --nEndStructureElement; + --m_nEndStructureElement; } CheckRestoreTag(); |