diff options
110 files changed, 1214 insertions, 1311 deletions
diff --git a/basctl/source/basicide/breakpoint.cxx b/basctl/source/basicide/breakpoint.cxx index 5c59bea38d5a..411b99475d6d 100644 --- a/basctl/source/basicide/breakpoint.cxx +++ b/basctl/source/basicide/breakpoint.cxx @@ -42,8 +42,8 @@ BreakPointList::~BreakPointList() void BreakPointList::reset() { - for ( size_t i = 0, n = maBreakPoints.size(); i < n; ++i ) - delete maBreakPoints[ i ]; + for (BreakPoint* pBreakPoint : maBreakPoints) + delete pBreakPoint; maBreakPoints.clear(); } @@ -74,9 +74,8 @@ void BreakPointList::SetBreakPointsInBasic(SbModule* pModule) { pModule->ClearAllBP(); - for ( size_t i = 0, n = maBreakPoints.size(); i < n; ++i ) + for (BreakPoint* pBrk : maBreakPoints) { - BreakPoint* pBrk = maBreakPoints[ i ]; if ( pBrk->bEnabled ) pModule->SetBP( (sal_uInt16)pBrk->nLine ); } @@ -84,9 +83,8 @@ void BreakPointList::SetBreakPointsInBasic(SbModule* pModule) BreakPoint* BreakPointList::FindBreakPoint(size_t nLine) { - for ( size_t i = 0, n = maBreakPoints.size(); i < n; ++i ) + for (BreakPoint* pBrk : maBreakPoints) { - BreakPoint* pBrk = maBreakPoints[ i ]; if ( pBrk->nLine == nLine ) return pBrk; } @@ -127,9 +125,8 @@ void BreakPointList::AdjustBreakPoints(size_t nLine, bool bInserted) void BreakPointList::ResetHitCount() { - for ( size_t i = 0, n = maBreakPoints.size(); i < n; ++i ) + for (BreakPoint* pBrk : maBreakPoints) { - BreakPoint* pBrk = maBreakPoints[ i ]; pBrk->nHitCount = 0; } } diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx index 535f7b457684..bfaaedec6f6e 100644 --- a/basegfx/source/polygon/b2dpolypolygon.cxx +++ b/basegfx/source/polygon/b2dpolypolygon.cxx @@ -105,9 +105,9 @@ public: void setClosed(bool bNew) { - for(size_t a(0L); a < maPolygons.size(); a++) + for(basegfx::B2DPolygon & rPolygon : maPolygons) { - maPolygons[a].setClosed(bNew); + rPolygon.setClosed(bNew); } } @@ -239,7 +239,7 @@ namespace basegfx bool B2DPolyPolygon::areControlPointsUsed() const { - for(sal_uInt32 a(0L); a < mpPolyPolygon->count(); a++) + for(sal_uInt32 a(0); a < mpPolyPolygon->count(); a++) { const B2DPolygon& rPolygon = mpPolyPolygon->getB2DPolygon(a); @@ -270,7 +270,7 @@ namespace basegfx { B2DPolyPolygon aRetval; - for(sal_uInt32 a(0L); a < mpPolyPolygon->count(); a++) + for(sal_uInt32 a(0); a < mpPolyPolygon->count(); a++) { aRetval.append(mpPolyPolygon->getB2DPolygon(a).getDefaultAdaptiveSubdivision()); } @@ -282,7 +282,7 @@ namespace basegfx { B2DRange aRetval; - for(sal_uInt32 a(0L); a < mpPolyPolygon->count(); a++) + for(sal_uInt32 a(0); a < mpPolyPolygon->count(); a++) { aRetval.expand(mpPolyPolygon->getB2DPolygon(a).getB2DRange()); } @@ -323,7 +323,7 @@ namespace basegfx // PolyPOlygon is closed when all contained Polygons are closed or // no Polygon exists. - for(sal_uInt32 a(0L); bRetval && a < mpPolyPolygon->count(); a++) + for(sal_uInt32 a(0); bRetval && a < mpPolyPolygon->count(); a++) { if(!(mpPolyPolygon->getB2DPolygon(a)).isClosed()) { @@ -352,7 +352,7 @@ namespace basegfx { bool bRetval(false); - for(sal_uInt32 a(0L); !bRetval && a < mpPolyPolygon->count(); a++) + for(sal_uInt32 a(0); !bRetval && a < mpPolyPolygon->count(); a++) { if((mpPolyPolygon->getB2DPolygon(a)).hasDoublePoints()) { diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 3809d107114a..70ca3476c73e 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1759,10 +1759,10 @@ void SbModule::GetCodeCompleteDataFromParse(CodeCompleteDataCache& aCache) if( (pSymDef->GetType() != SbxEMPTY) && (pSymDef->GetType() != SbxNULL) ) aCache.InsertGlobalVar( pSymDef->GetName(), pParser->aGblStrings.Find(pSymDef->GetTypeId()) ); - SbiSymPool& pChildPool = pSymDef->GetPool(); - for(sal_uInt16 j = 0; j < pChildPool.GetSize(); ++j ) + SbiSymPool& rChildPool = pSymDef->GetPool(); + for(sal_uInt16 j = 0; j < rChildPool.GetSize(); ++j ) { - SbiSymDef* pChildSymDef = pChildPool.Get(j); + SbiSymDef* pChildSymDef = rChildPool.Get(j); //std::cerr << "j: " << j << ", type: " << pChildSymDef->GetType() << "; name:" << pChildSymDef->GetName() << std::endl; if( (pChildSymDef->GetType() != SbxEMPTY) && (pChildSymDef->GetType() != SbxNULL) ) aCache.InsertLocalVar( pSymDef->GetName(), pChildSymDef->GetName(), pParser->aGblStrings.Find(pChildSymDef->GetTypeId()) ); diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx index 63dfa286a6e8..aba30edb7c72 100644 --- a/chart2/source/model/main/BaseCoordinateSystem.cxx +++ b/chart2/source/model/main/BaseCoordinateSystem.cxx @@ -30,9 +30,6 @@ #include <algorithm> #include <iterator> -#if OSL_DEBUG_LEVEL > 1 -#include <rtl/math.hxx> -#endif #include <com/sun/star/beans/PropertyAttribute.hpp> using namespace ::com::sun::star; @@ -88,7 +85,7 @@ struct StaticCooSysInfoHelper_Initializer private: static Sequence< Property > lcl_GetPropertySequence() { - ::std::vector< ::com::sun::star::beans::Property > aProperties; + ::std::vector< css::beans::Property > aProperties; lcl_AddPropertiesToVector( aProperties ); ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); @@ -188,8 +185,8 @@ BaseCoordinateSystem::~BaseCoordinateSystem() { try { - for( tAxisVecVecType::size_type nN=0; nN<m_aAllAxis.size(); nN++ ) - ModifyListenerHelper::removeListenerFromAllElements( m_aAllAxis[nN], m_xModifyEventForwarder ); + for(tAxisVecVecType::value_type & i : m_aAllAxis) + ModifyListenerHelper::removeListenerFromAllElements( i, m_xModifyEventForwarder ); ModifyListenerHelper::removeListenerFromAllElements( m_aChartTypes, m_xModifyEventForwarder ); } catch( const uno::Exception & ex ) diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx index 63c733619455..8680e00e6e34 100644 --- a/comphelper/source/misc/threadpool.cxx +++ b/comphelper/source/misc/threadpool.cxx @@ -103,8 +103,8 @@ ThreadPool::ThreadPool( sal_Int32 nWorkers ) : maTasksComplete.set(); osl::MutexGuard aGuard( maGuard ); - for( size_t i = 0; i < maWorkers.size(); i++ ) - maWorkers[ i ]->launch(); + for(rtl::Reference<ThreadWorker> & rpWorker : maWorkers) + rpWorker->launch(); } ThreadPool::~ThreadPool() @@ -176,8 +176,8 @@ void ThreadPool::pushTask( ThreadTask *pTask ) maTasks.insert( maTasks.begin(), pTask ); // horrible beyond belief: - for( size_t i = 0; i < maWorkers.size(); i++ ) - maWorkers[ i ]->signalNewWork(); + for(rtl::Reference<ThreadWorker> & rpWorker : maWorkers) + rpWorker->signalNewWork(); maTasksComplete.reset(); } diff --git a/compilerplugins/clang/stylepolice.cxx b/compilerplugins/clang/stylepolice.cxx new file mode 100644 index 000000000000..93b1fcea5a57 --- /dev/null +++ b/compilerplugins/clang/stylepolice.cxx @@ -0,0 +1,142 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <regex> +#include <string> +#include <set> + +#include "compat.hxx" +#include "plugin.hxx" + +// Check for some basic naming mismatches which make the code harder to read + +namespace { + +class StylePolice : + public RecursiveASTVisitor<StylePolice>, public loplugin::Plugin +{ +public: + explicit StylePolice(InstantiationData const & data): Plugin(data) {} + + virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } + + bool VisitVarDecl(const VarDecl *); +private: + StringRef getFilename(SourceLocation loc); +}; + +StringRef StylePolice::getFilename(SourceLocation loc) +{ + SourceLocation spellingLocation = compiler.getSourceManager().getSpellingLoc(loc); + StringRef name { compiler.getSourceManager().getFilename(spellingLocation) }; + return name; +} + +bool startswith(const std::string& rStr, const char* pSubStr) { + return rStr.compare(0, strlen(pSubStr), pSubStr) == 0; +} +bool isUpperLetter(char c) { + return c >= 'A' && c <= 'Z'; +} +bool isLowerLetter(char c) { + return c >= 'a' && c <= 'z'; +} +bool isIdentifierLetter(char c) { + return isUpperLetter(c) || isLowerLetter(c); +} +bool matchPointerVar(const std::string& s) { + return s.size() > 2 && s[0] == 'p' && isUpperLetter(s[1]); +} +bool matchMember(const std::string& s) { + return s.size() > 3 && s[0] == 'm' + && ( ( strchr("abnprsx", s[1]) && isUpperLetter(s[2]) ) + || ( s[1] == '_' && isIdentifierLetter(s[2]) ) ); +} + +bool StylePolice::VisitVarDecl(const VarDecl * varDecl) +{ + if (ignoreLocation(varDecl)) { + return true; + } + StringRef aFileName = getFilename(varDecl->getLocStart()); + std::string name = varDecl->getName(); + + if (!varDecl->isLocalVarDecl()) { + return true; + } + + if (matchMember(name)) + { + // these names appear to be taken from some scientific paper + if (aFileName == SRCDIR "/scaddins/source/analysis/bessel.cxx" ) { + } + // lots of places where we are storing a "method id" here + else if (aFileName.startswith(SRCDIR "/connectivity/source/drivers/jdbc") && name.compare(0,3,"mID") == 0) { + } + else { + report( + DiagnosticsEngine::Warning, + "this local variable follows our member field naming convention, which is confusing", + varDecl->getLocation()) + << varDecl->getType() << varDecl->getSourceRange(); + } + } + + QualType qt = varDecl->getType().getDesugaredType(compiler.getASTContext()).getCanonicalType(); + qt = qt.getNonReferenceType(); + std::string typeName = qt.getAsString(); + if (startswith(typeName, "const ")) + typeName = typeName.substr(6); + if (startswith(typeName, "class ")) + typeName = typeName.substr(6); + std::string aOriginalTypeName = varDecl->getType().getAsString(); + if (!qt->isPointerType() && !qt->isArrayType() && !qt->isFunctionPointerType() && !qt->isMemberPointerType() + && matchPointerVar(name) + && !startswith(typeName, "boost::intrusive_ptr") + && !startswith(typeName, "boost::optional") + && !startswith(typeName, "boost::shared_ptr") + && !startswith(typeName, "com::sun::star::uno::Reference") + && !startswith(typeName, "cppu::OInterfaceIteratorHelper") + && !startswith(typeName, "formula::FormulaCompiler::CurrentFactor") + && aOriginalTypeName != "GLXPixmap" + && !startswith(typeName, "rtl::Reference") + && !startswith(typeName, "ScopedVclPtr") + && !startswith(typeName, "std::mem_fun") + && !startswith(typeName, "std::shared_ptr") + && !startswith(typeName, "shared_ptr") // weird issue in slideshow + && !startswith(typeName, "std::unique_ptr") + && !startswith(typeName, "unique_ptr") // weird issue in include/vcl/threadex.hxx + && !startswith(typeName, "std::weak_ptr") + && !startswith(typeName, "struct _LOKDocViewPrivate") + && !startswith(typeName, "sw::UnoCursorPointer") + && !startswith(typeName, "tools::SvRef") + && !startswith(typeName, "VclPtr") + && !startswith(typeName, "vcl::ScopedBitmapAccess") + // lots of the code seems to regard iterator objects as being "pointer-like" + && typeName.find("iterator<") == std::string::npos + && aOriginalTypeName != "sal_IntPtr" ) + { + if (aFileName.startswith(SRCDIR "/bridges/") ) { + } else if (aFileName.startswith(SRCDIR "/vcl/source/fontsubset/sft.cxx") ) { + } else { + report( + DiagnosticsEngine::Warning, + "this local variable of type '%0' follows our pointer naming convention, but it is not a pointer, %1", + varDecl->getLocation()) + << typeName << aOriginalTypeName << varDecl->getSourceRange(); + } + } + return true; +} + +loplugin::Plugin::Registration< StylePolice > X("stylepolice"); + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index eb44d5fa4c6c..f146a38973d7 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -29,6 +29,7 @@ #include <dialmgr.hxx> #include "cuires.hrc" +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <com/sun/star/xml/sax/XParser.hpp> #include <com/sun/star/xml/sax/Parser.hpp> @@ -85,10 +86,10 @@ SelectPersonaDialog::SelectPersonaDialog( vcl::Window *pParent ) get( m_vResultList[7], "result8" ); get( m_vResultList[8], "result9" ); - for (sal_Int32 nIndex = 0; nIndex < 9; ++nIndex) + for (VclPtr<PushButton> & nIndex : m_vResultList) { - m_vResultList[nIndex]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) ); - m_vResultList[nIndex]->Disable(); + nIndex->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) ); + nIndex->Disable(); } } @@ -102,9 +103,9 @@ void SelectPersonaDialog::dispose() m_pEdit.clear(); m_pSearchButton.clear(); m_pProgressLabel.clear(); - for (VclPtr<PushButton> vp : m_vResultList) + for (VclPtr<PushButton>& vp : m_vResultList) vp.clear(); - for (VclPtr<PushButton> vp : m_vSearchSuggestions) + for (VclPtr<PushButton>& vp : m_vSearchSuggestions) vp.clear(); m_pOkButton.clear(); m_pCancelButton.clear(); @@ -129,11 +130,11 @@ IMPL_LINK_TYPED( SelectPersonaDialog, SearchPersonas, Button*, pButton, void ) searchTerm = m_pEdit->GetText(); else { - for( sal_Int32 nIndex = 0; nIndex < 5; nIndex++ ) + for(VclPtr<PushButton> & i : m_vSearchSuggestions) { - if( pButton == m_vSearchSuggestions[nIndex] ) + if( pButton == i ) { - searchTerm = m_vSearchSuggestions[nIndex]->GetDisplayText(); + searchTerm = i->GetDisplayText(); break; } } @@ -142,38 +143,7 @@ IMPL_LINK_TYPED( SelectPersonaDialog, SearchPersonas, Button*, pButton, void ) if( searchTerm.isEmpty( ) ) return; - // TODO FIXME! - // Before the release, the allizom.org url should be changed to: - // OUString rSearchURL = "https://services.addons.mozilla.org/en-US/firefox/api/1.5/search/" + searchTerm + "/9/9"; - // The problem why it cannot be done just now is that the SSL negotiation - // with services.addons.mozilla.org fails very early - during an early - // propfind, SSL returns X509_V_ERR_CERT_UNTRUSTED to neon, causing the - // NE_SSL_UNTRUSTED being set in verify_callback in neon/src/ne_openssl.c - // - // This is not cleared anywhere during the init, and so later, even though - // we have found the certificate, this triggers - // NeonSession_CertificationNotify callback, that - // causes that NE_SSL_UNTRUSTED is ignored in cases when the condition - // if ( pSession->isDomainMatch( - // GetHostnamePart( xEECert.get()->getSubjectName() ) ) ) - // is true; but that is only when getSubjectName() actually returns a - // wildcard, or the exact name. - // - // In the case of services.addons.mozilla.com, the certificate is for - // versioncheck.addons.mozilla.com, but it also has - // X509v3 Subject Alternative Name: - // DNS:services.addons.mozilla.org, DNS:versioncheck-bg.addons.mozilla.org, DNS:pyrepo.addons.mozilla.org, DNS:versioncheck.addons.mozilla.org - // So it is all valid; but the early X509_V_ERR_CERT_UNTRUSTED failure - // described above just makes this being ignored. - // - // My suspicion is that this never actually worked, and the - // if ( pSession->isDomainMatch( - // GetHostnamePart( xEECert.get()->getSubjectName() ) ) ) - // works around the root cause that is there for years, and which makes it - // work in most cases. I guess that we initialize something wrongly or - // too late; but I have already spent few hours debugging, and - // give up for the moment - need to return to this at some stage. - OUString rSearchURL = "https://addons.allizom.org/en-US/firefox/api/1.5/search/" + searchTerm + "/9/9"; + OUString rSearchURL = "https://services.addons.mozilla.org/en-US/firefox/api/1.5/search/" + searchTerm + "/9/9"; m_rSearchThread = new SearchAndParseThread( this, rSearchURL ); m_rSearchThread->launch(); } @@ -266,10 +236,10 @@ void SelectPersonaDialog::ClearSearchResults() { m_vPersonaSettings.clear(); m_aSelectedPersona.clear(); - for( sal_Int32 nIndex = 0; nIndex < 9; nIndex++ ) + for(VclPtr<PushButton> & nIndex : m_vResultList) { - m_vResultList[nIndex]->Disable(); - m_vResultList[nIndex]->SetModeImage(Image()); + nIndex->Disable(); + nIndex->SetModeImage(Image()); } } @@ -317,8 +287,8 @@ void SvxPersonalizationTabPage::dispose() m_pDefaultPersona.clear(); m_pOwnPersona.clear(); m_pSelectPersona.clear(); - for (int i=0; i<3; ++i) - m_vDefaultPersonaImages[i].clear(); + for (VclPtr<PushButton> & i : m_vDefaultPersonaImages) + i.clear(); m_pExtensionPersonaPreview.clear(); m_pPersonaList.clear(); m_pExtensionLabel.clear(); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index a5a064dcbc6d..5a8923ea928e 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1768,7 +1768,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) nPageId = (sal_uInt16)rInetArray.GetValue(i); if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) continue; -#if defined WNT +#if defined(_WIN32) // Disable E-mail tab-page on Windows if ( nPageId == RID_SVXPAGE_INET_MAIL ) continue; @@ -1801,8 +1801,8 @@ bool isNodeActive( OptionsNode* pNode, Module* pModule ) // search node in active module if ( pModule->m_bActive ) { - for ( size_t j = 0; j < pModule->m_aNodeList.size(); ++j ) - if ( pModule->m_aNodeList[j]->m_sId == pNode->m_sId ) + for (OrderedEntry* j : pModule->m_aNodeList) + if ( j->m_sId == pNode->m_sId ) return true; } } @@ -1995,22 +1995,18 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes( bool bAlreadyOpened = false; if ( pNode->m_aGroupedLeaves.size() > 0 ) { - for ( size_t k = 0; - k < pNode->m_aGroupedLeaves.size(); ++k ) + for (std::vector<OptionsLeaf*> & rGroup : pNode->m_aGroupedLeaves) { - if ( pNode->m_aGroupedLeaves[k].size() > 0 && - pNode->m_aGroupedLeaves[k][0]->m_sGroupId - == sLeafGrpId ) + if ( rGroup.size() > 0 && + rGroup[0]->m_sGroupId == sLeafGrpId ) { sal_uInt32 l = 0; - for ( ; l < pNode->m_aGroupedLeaves[k].size(); ++l ) + for ( ; l < rGroup.size(); ++l ) { - if ( pNode->m_aGroupedLeaves[k][l]-> - m_nGroupIndex >= nLeafGrpIdx ) + if ( rGroup[l]->m_nGroupIndex >= nLeafGrpIdx ) break; } - pNode->m_aGroupedLeaves[k].insert( - pNode->m_aGroupedLeaves[k].begin() + l, pLeaf ); + rGroup.insert( rGroup.begin() + l, pLeaf ); bAlreadyOpened = true; break; } @@ -2066,7 +2062,6 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes( static sal_uInt16 lcl_getGroupId( const OUString& rGroupName, const SvTreeListBox& rTreeLB ) { - OUString sGroupName( rGroupName ); sal_uInt16 nRet = 0; SvTreeListEntry* pEntry = rTreeLB.First(); while( pEntry ) @@ -2074,7 +2069,7 @@ static sal_uInt16 lcl_getGroupId( const OUString& rGroupName, const SvTreeListBo if ( !rTreeLB.GetParent( pEntry ) ) { OUString sTemp( rTreeLB.GetEntryText( pEntry ) ); - if ( sTemp == sGroupName ) + if ( sTemp == rGroupName ) return nRet; nRet++; } @@ -2111,10 +2106,8 @@ static void lcl_insertLeaf( void OfaTreeOptionsDialog::InsertNodes( const VectorOfNodes& rNodeList ) { - for ( size_t i = 0; i < rNodeList.size(); ++i ) + for (OptionsNode* pNode : rNodeList) { - OptionsNode* pNode = rNodeList[i]; - if ( pNode->m_aLeaves.size() > 0 || pNode->m_aGroupedLeaves.size() > 0 ) { sal_uInt32 j = 0; @@ -2202,7 +2195,6 @@ void ExtensionsTabPage::dispose() } - void ExtensionsTabPage::CreateDialogWithHandler() { try @@ -2246,7 +2238,6 @@ void ExtensionsTabPage::CreateDialogWithHandler() } - bool ExtensionsTabPage::DispatchAction( const OUString& rAction ) { bool bRet = false; @@ -2285,7 +2276,7 @@ void ExtensionsTabPage::ActivatePage() if ( m_xPage.is() ) { - m_xPage->setVisible( sal_True ); + m_xPage->setVisible( true ); m_bIsWindowHidden = false; } } @@ -2295,11 +2286,10 @@ void ExtensionsTabPage::DeactivatePage() TabPage::DeactivatePage(); if ( m_xPage.is() ) - m_xPage->setVisible( sal_False ); + m_xPage->setVisible( false ); } - void ExtensionsTabPage::ResetPage() { DispatchAction( "back" ); @@ -2307,7 +2297,6 @@ void ExtensionsTabPage::ResetPage() } - void ExtensionsTabPage::SavePage() { DispatchAction( "ok" ); diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 14bf274a63af..f7a4682e393a 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -54,6 +54,7 @@ #include <boost/optional.hpp> #include <memory> +#include <iterator> namespace dbaxml { @@ -346,7 +347,7 @@ void ODBExport::exportDataSource() } }; - PropertyMap aTokens[] = + const PropertyMap aTokens[] = { PropertyMap( INFO_TEXTFILEHEADER, XML_IS_FIRST_ROW_HEADER_LINE, s_sTrue ), PropertyMap( INFO_SHOWDELETEDROWS, XML_SHOW_DELETED, s_sFalse ), @@ -363,14 +364,14 @@ void ODBExport::exportDataSource() }; bool bIsXMLDefault = false; - for ( size_t i=0; i < sizeof( aTokens ) / sizeof( aTokens[0] ); ++i ) + for (const auto & aToken : aTokens) { - if ( pProperties->Name == aTokens[i].sPropertyName ) + if ( pProperties->Name == aToken.sPropertyName ) { - eToken = aTokens[i].eAttributeToken; + eToken = aToken.eAttributeToken; - if ( !!aTokens[i].aXMLDefault - && ( sValue == *aTokens[i].aXMLDefault ) + if ( !!aToken.aXMLDefault + && ( sValue == *aToken.aXMLDefault ) ) { bIsXMLDefault = true; @@ -497,9 +498,9 @@ void ODBExport::exportApplicationConnectionSettings(const TSettingsMap& _aSettin ,XML_MAX_ROW_COUNT ,XML_SUPPRESS_VERSION_COLUMNS }; - for (size_t i = 0; i< sizeof(pSettings)/sizeof(pSettings[0]); ++i) + for (::xmloff::token::XMLTokenEnum i : pSettings) { - TSettingsMap::const_iterator aFind = _aSettings.find(pSettings[i]); + TSettingsMap::const_iterator aFind = _aSettings.find(i); if ( aFind != _aSettings.end() ) AddAttribute(XML_NAMESPACE_DB, aFind->first,aFind->second); } @@ -530,9 +531,9 @@ void ODBExport::exportDriverSettings(const TSettingsMap& _aSettings) ,XML_IS_FIRST_ROW_HEADER_LINE ,XML_PARAMETER_NAME_SUBSTITUTION }; - for (size_t i = 0; i< sizeof(pSettings)/sizeof(pSettings[0]); ++i) + for (::xmloff::token::XMLTokenEnum nSetting : pSettings) { - TSettingsMap::const_iterator aFind = _aSettings.find(pSettings[i]); + TSettingsMap::const_iterator aFind = _aSettings.find(nSetting); if ( aFind != _aSettings.end() ) AddAttribute(XML_NAMESPACE_DB, aFind->first,aFind->second); } @@ -661,7 +662,7 @@ void ODBExport::exportDataSourceSettings() SvXMLElementExport aElem(*this,XML_NAMESPACE_DB, XML_DATA_SOURCE_SETTINGS, true, true); ::std::vector< TypedPropertyValue >::iterator aIter = m_aDataSourceSettings.begin(); - ::std::vector< TypedPropertyValue >::iterator aEnd = m_aDataSourceSettings.end(); + ::std::vector< TypedPropertyValue >::const_iterator aEnd = m_aDataSourceSettings.end(); for ( ; aIter != aEnd; ++aIter ) { bool bIsSequence = TypeClass_SEQUENCE == aIter->Type.getTypeClass(); @@ -905,7 +906,7 @@ void ODBExport::exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt) void ODBExport::exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const uno::Reference<beans::XPropertySet>& _xProp,SvXMLAttributeList& _rAtt,TPropertyStyleMap& _rMap) { - TPropertyStyleMap::iterator aFind = _rMap.find(_xProp); + TPropertyStyleMap::const_iterator aFind = _rMap.find(_xProp); if ( aFind != _rMap.end() ) { _rAtt.AddAttribute( GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DB, GetXMLToken(_eToken) ), @@ -962,7 +963,7 @@ void ODBExport::exportColumns(const Reference<XColumnsSupplier>& _xColSup) if ( !xNameAccess->hasElements() ) { Reference< XPropertySet > xComponent(_xColSup,UNO_QUERY); - TTableColumnMap::iterator aFind = m_aTableDummyColumns.find(xComponent); + TTableColumnMap::const_iterator aFind = m_aTableDummyColumns.find(xComponent); if ( aFind != m_aTableDummyColumns.end() ) { SvXMLElementExport aColumns(*this,XML_NAMESPACE_DB, XML_COLUMNS, true, true); @@ -1131,11 +1132,11 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp) }; ::std::vector< XMLPropertyState > aPropertyStates; - for (size_t i = 0 ; i < sizeof(pExportHelper)/sizeof(pExportHelper[0]); ++i) + for (const auto & i : pExportHelper) { - aPropertyStates = pExportHelper[i].first->Filter(_xProp); + aPropertyStates = i.first->Filter(_xProp); if ( !aPropertyStates.empty() ) - pExportHelper[i].second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( pExportHelper[i].second.second, aPropertyStates ))); + i.second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( i.second.second, aPropertyStates ))); } Reference< XNameAccess > xCollection; @@ -1172,18 +1173,18 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp) } else { // here I know I have a column - TExportPropMapperPair pExportHelper[] = { + const TExportPropMapperPair pExportHelper[] = { TExportPropMapperPair(m_xColumnExportHelper,TEnumMapperPair(&m_aAutoStyleNames,XML_STYLE_FAMILY_TABLE_COLUMN )) ,TExportPropMapperPair(m_xCellExportHelper,TEnumMapperPair(&m_aCellAutoStyleNames,XML_STYLE_FAMILY_TABLE_CELL)) }; - for (size_t i = 0 ; i < sizeof(pExportHelper)/sizeof(pExportHelper[0]); ++i) + for (const auto & i : pExportHelper) { - ::std::vector< XMLPropertyState > aPropStates = pExportHelper[i].first->Filter( _xProp ); + ::std::vector< XMLPropertyState > aPropStates = i.first->Filter( _xProp ); if ( !aPropStates.empty() ) { ::std::vector< XMLPropertyState >::iterator aItr = aPropStates.begin(); - ::std::vector< XMLPropertyState >::iterator aEnd = aPropStates.end(); - const rtl::Reference < XMLPropertySetMapper >& pStyle = pExportHelper[i].first->getPropertySetMapper(); + ::std::vector< XMLPropertyState >::const_iterator aEnd = aPropStates.end(); + const rtl::Reference < XMLPropertySetMapper >& pStyle = i.first->getPropertySetMapper(); while ( aItr != aEnd ) { if ( aItr->mnIndex != -1 ) @@ -1207,10 +1208,10 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp) } } - if ( XML_STYLE_FAMILY_TABLE_CELL == pExportHelper[i].second.second ) + if ( XML_STYLE_FAMILY_TABLE_CELL == i.second.second ) ::std::copy( m_aCurrentPropertyStates.begin(), m_aCurrentPropertyStates.end(), ::std::back_inserter( aPropStates )); if ( !aPropStates.empty() ) - pExportHelper[i].second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( pExportHelper[i].second.second, aPropStates ))); + i.second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( i.second.second, aPropStates ))); } } } diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index c2b063f8f0e3..533574a4c180 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -219,8 +219,8 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo m_xWindow = VCLUnoHelper::GetInterface( m_pTablePreview ); SetUniqueId(UID_APP_DETAILPAGE_HELPER); - for (int i=0; i < E_ELEMENT_TYPE_COUNT; ++i) - m_pLists[i] = nullptr; + for (VclPtr<DBTreeListBox> & rpBox : m_pLists) + rpBox = nullptr; ImplInitSettings(); } @@ -235,21 +235,21 @@ void OAppDetailPageHelper::dispose() { Reference< ::util::XCloseable> xCloseable(m_xFrame,UNO_QUERY); if ( xCloseable.is() ) - xCloseable->close(sal_True); + xCloseable->close(true); } catch(const Exception&) { OSL_FAIL("Exception thrown while disposing preview frame!"); } - for (int i=0; i < E_ELEMENT_TYPE_COUNT; ++i) + for (VclPtr<DBTreeListBox> & rpBox : m_pLists) { - if ( m_pLists[i] ) + if ( rpBox ) { - m_pLists[i]->clearCurrentSelection(); - m_pLists[i]->Hide(); - m_pLists[i]->clearCurrentSelection(); // why a second time? - m_pLists[i].disposeAndClear(); + rpBox->clearCurrentSelection(); + rpBox->Hide(); + rpBox->clearCurrentSelection(); // why a second time? + rpBox.disposeAndClear(); } } m_aMenu.reset(); @@ -429,8 +429,7 @@ void OAppDetailPageHelper::describeCurrentSelectionForType( const ElementType _e pEntry = pList->NextSelected(pEntry); } - _out_rSelectedObjects.realloc( aSelected.size() ); - ::std::copy( aSelected.begin(), aSelected.end(), _out_rSelectedObjects.getArray() ); + _out_rSelectedObjects = comphelper::containerToSequence( aSelected ); } void OAppDetailPageHelper::selectElements(const Sequence< OUString>& _aNames) @@ -686,7 +685,7 @@ namespace namespace DatabaseObject = ::com::sun::star::sdb::application::DatabaseObject; namespace DatabaseObjectContainer = ::com::sun::star::sdb::application::DatabaseObjectContainer; - static sal_Int32 lcl_getFolderIndicatorForType( const ElementType _eType ) + sal_Int32 lcl_getFolderIndicatorForType( const ElementType _eType ) { const sal_Int32 nFolderIndicator = ( _eType == E_FORM ) ? DatabaseObjectContainer::FORMS_FOLDER @@ -772,10 +771,10 @@ DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, cons void OAppDetailPageHelper::clearPages() { showPreview(nullptr); - for (size_t i=0; i < E_ELEMENT_TYPE_COUNT; ++i) + for (VclPtr<DBTreeListBox> & rpBox : m_pLists) { - if ( m_pLists[i] ) - m_pLists[i]->Clear(); + if ( rpBox ) + rpBox->Clear(); } } @@ -794,7 +793,6 @@ void OAppDetailPageHelper::elementReplaced(ElementType _eType DBTreeListBox* pTreeView = getCurrentView(); if ( pTreeView ) { - OUString sNewName = _rNewName; SvTreeListEntry* pEntry = nullptr; switch( _eType ) { @@ -816,7 +814,7 @@ void OAppDetailPageHelper::elementReplaced(ElementType _eType OSL_ENSURE(pEntry,"Do you know that the name isn't existence!"); if ( pEntry ) { - pTreeView->SetEntryText(pEntry,sNewName); + pTreeView->SetEntryText(pEntry,_rNewName); } } } @@ -1119,10 +1117,10 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName, pDispatcher->setTargetFrame( Reference<XFrame>(m_xFrame,UNO_QUERY_THROW) ); ::comphelper::NamedValueCollection aArgs; - aArgs.put( "Preview", sal_True ); - aArgs.put( "ReadOnly", sal_True ); - aArgs.put( "AsTemplate", sal_False ); - aArgs.put( OUString(PROPERTY_SHOWMENU), sal_False ); + aArgs.put( "Preview", true ); + aArgs.put( "ReadOnly", true ); + aArgs.put( "AsTemplate", false ); + aArgs.put( OUString(PROPERTY_SHOWMENU), false ); Reference< XController > xPreview( pDispatcher->openExisting( makeAny( _sDataSourceName ), _sName, aArgs ), UNO_QUERY ); bool bClearPreview = !xPreview.is(); @@ -1160,14 +1158,14 @@ IMPL_LINK_NOARG_TYPED(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, void) // execute the menu std::unique_ptr<PopupMenu> aMenu(new PopupMenu( ModuleRes( RID_MENU_APP_PREVIEW ) )); - sal_uInt16 pActions[] = { SID_DB_APP_DISABLE_PREVIEW + const sal_uInt16 pActions[] = { SID_DB_APP_DISABLE_PREVIEW , SID_DB_APP_VIEW_DOC_PREVIEW , SID_DB_APP_VIEW_DOCINFO_PREVIEW }; - for(size_t i=0; i < sizeof(pActions)/sizeof(pActions[0]);++i) + for(unsigned short nAction : pActions) { - aMenu->CheckItem(pActions[i],m_aMenu->IsItemChecked(pActions[i])); + aMenu->CheckItem(nAction,m_aMenu->IsItemChecked(nAction)); } aMenu->EnableItem( SID_DB_APP_VIEW_DOCINFO_PREVIEW, getBorderWin().getView()->getAppController().isCommandEnabled(SID_DB_APP_VIEW_DOCINFO_PREVIEW) ); diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index d7a0fd7cd1a0..0db7db70d60d 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -196,9 +196,9 @@ namespace dbaui { std::addressof(m_pRespectDriverResultSetType), "resulttype", DSID_RESPECTRESULTSETTYPE, false } }; - for ( const BooleanSettingDesc& pCopy : aSettings ) + for ( const BooleanSettingDesc& rDesc : aSettings ) { - m_aBooleanSettings.push_back( pCopy ); + m_aBooleanSettings.push_back( rDesc ); } } diff --git a/drawinglayer/source/animation/animationtiming.cxx b/drawinglayer/source/animation/animationtiming.cxx index 2e5f6040df07..72400c1cd5dd 100644 --- a/drawinglayer/source/animation/animationtiming.cxx +++ b/drawinglayer/source/animation/animationtiming.cxx @@ -21,7 +21,6 @@ #include <basegfx/numeric/ftools.hxx> - namespace drawinglayer { namespace animation @@ -37,7 +36,6 @@ namespace drawinglayer } - AnimationEntryFixed::AnimationEntryFixed(double fDuration, double fState) : mfDuration(fDuration), mfState(fState) @@ -85,7 +83,6 @@ namespace drawinglayer } - AnimationEntryLinear::AnimationEntryLinear(double fDuration, double fFrequency, double fStart, double fStop) : mfDuration(fDuration), mfFrequency(fFrequency), @@ -162,7 +159,6 @@ namespace drawinglayer } - sal_uInt32 AnimationEntryList::impGetIndexAtTime(double fTime, double &rfAddedTime) const { sal_uInt32 nIndex(0L); @@ -182,9 +178,9 @@ namespace drawinglayer AnimationEntryList::~AnimationEntryList() { - for(size_t a(0); a < maEntries.size(); a++) + for(AnimationEntry* i : maEntries) { - delete maEntries[a]; + delete i; } } @@ -192,9 +188,9 @@ namespace drawinglayer { AnimationEntryList* pNew = new AnimationEntryList(); - for(size_t a(0); a < maEntries.size(); a++) + for(AnimationEntry* i : maEntries) { - pNew->append(*maEntries[a]); + pNew->append(*i); } return pNew; @@ -271,7 +267,6 @@ namespace drawinglayer } - AnimationEntryLoop::AnimationEntryLoop(sal_uInt32 nRepeat) : AnimationEntryList(), mnRepeat(nRepeat) @@ -286,9 +281,9 @@ namespace drawinglayer { AnimationEntryLoop* pNew = new AnimationEntryLoop(mnRepeat); - for(size_t a(0); a < maEntries.size(); a++) + for(AnimationEntry* i : maEntries) { - pNew->append(*maEntries[a]); + pNew->append(*i); } return pNew; diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 9b484a3079f7..6aa93695dc7c 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -71,8 +71,6 @@ using namespace ::com::sun::star; - - sal_uInt16 GetScriptItemId( sal_uInt16 nItemId, SvtScriptType nScriptType ) { sal_uInt16 nId = nItemId; @@ -465,7 +463,7 @@ void TextPortionList::Remove(sal_Int32 nPos) namespace { -class FindTextPortionByAddress : std::unary_function<std::unique_ptr<TextPortion>, bool> +class FindTextPortionByAddress : public std::unary_function<std::unique_ptr<TextPortion>, bool> { const TextPortion* mp; public: @@ -690,8 +688,8 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( sal_Int32 nLastFormatted namespace { -template<typename _Array, typename _Val> -sal_Int32 FastGetPos(const _Array& rArray, const _Val* p, sal_Int32& rLastPos) +template<typename Array, typename Val> +sal_Int32 FastGetPos(const Array& rArray, const Val* p, sal_Int32& rLastPos) { sal_Int32 nArrayLen = rArray.size(); @@ -805,9 +803,9 @@ void ParaPortionList::Reset() long ParaPortionList::GetYOffset(const ParaPortion* pPPortion) const { long nHeight = 0; - for (sal_Int32 i = 0, n = maPortions.size(); i < n; ++i) + for (const auto & rPortion : maPortions) { - const ParaPortion* pTmpPortion = maPortions[i].get(); + const ParaPortion* pTmpPortion = rPortion.get(); if ( pTmpPortion == pPPortion ) return nHeight; nHeight += pTmpPortion->GetHeight(); @@ -1004,7 +1002,6 @@ EditLine::~EditLine() } - EditLine* EditLine::Clone() const { EditLine* pL = new EditLine; @@ -1169,7 +1166,6 @@ EditPaM::EditPaM(const EditPaM& r) : pNode(r.pNode), nIndex(r.nIndex) {} EditPaM::EditPaM(ContentNode* p, sal_Int32 n) : pNode(p), nIndex(n) {} - void EditPaM::SetNode(ContentNode* p) { pNode = p; @@ -1984,7 +1980,7 @@ EditDoc::~EditDoc() namespace { -class RemoveEachItemFromPool : std::unary_function<std::unique_ptr<ContentNode>, void> +class RemoveEachItemFromPool : public std::unary_function<std::unique_ptr<ContentNode>, void> { EditDoc& mrDoc; public: @@ -2328,7 +2324,7 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, bool bKeepEndingAttribs ) // for a new paragraph we like to have the bullet/numbering visible by default aContentAttribs.GetItems().Put( SfxBoolItem( EE_PARA_BULLETSTATE, true), EE_PARA_BULLETSTATE ); - // ContenNode constructor copies also the paragraph attributes + // ContentNode constructor copies also the paragraph attributes ContentNode* pNode = new ContentNode( aStr, aContentAttribs ); // Copy the Default Font @@ -2887,10 +2883,9 @@ bool CharAttribList::HasAttrib( sal_Int32 nStartPos, sal_Int32 nEndPos ) const } - namespace { -class FindByAddress : std::unary_function<std::unique_ptr<EditCharAttrib>, bool> +class FindByAddress : public std::unary_function<std::unique_ptr<EditCharAttrib>, bool> { const EditCharAttrib* mpAttr; public: @@ -2978,7 +2973,7 @@ EditCharAttrib* CharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_Int32 nP namespace { -class FindByStartPos : std::unary_function<std::unique_ptr<EditCharAttrib>, bool> +class FindByStartPos : public std::unary_function<std::unique_ptr<EditCharAttrib>, bool> { sal_Int32 mnPos; public: @@ -3008,7 +3003,7 @@ const EditCharAttrib* CharAttribList::FindFeature( sal_Int32 nPos ) const namespace { -class RemoveEmptyAttrItem : std::unary_function<std::unique_ptr<EditCharAttrib>, void> +class RemoveEmptyAttrItem : public std::unary_function<std::unique_ptr<EditCharAttrib>, void> { SfxItemPool& mrItemPool; public: diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 7c459f46b818..72a9aa16a40a 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1803,16 +1803,16 @@ static bool lcl_FindAbbreviation(const SvStringsISortDtor* pList, const OUString if( nPos < pList->size() ) { OUString sLowerWord(sWord.toAsciiLowerCase()); - OUString pAbk; + OUString sAbr; for( sal_uInt16 n = nPos; n < pList->size() && - '~' == ( pAbk = (*pList)[ n ])[ 0 ]; + '~' == ( sAbr = (*pList)[ n ])[ 0 ]; ++n ) { // ~ and ~. are not allowed! - if( 2 < pAbk.getLength() && pAbk.getLength() - 1 <= sWord.getLength() ) + if( 2 < sAbr.getLength() && sAbr.getLength() - 1 <= sWord.getLength() ) { - OUString sLowerAbk(pAbk.toAsciiLowerCase()); + OUString sLowerAbk(sAbr.toAsciiLowerCase()); for (sal_Int32 i = sLowerAbk.getLength(), ii = sLowerWord.getLength(); i;) { if( !--i ) // agrees diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx index ccdb44cd8492..4bb645f3707e 100644 --- a/extensions/source/scanner/grid.cxx +++ b/extensions/source/scanner/grid.cxx @@ -118,7 +118,7 @@ class GridWindow : public vcl::Window virtual Size GetOptimalSize() const override; void drawLine(vcl::RenderContext& rRenderContext, double x1, double y1, double x2, double y2); public: - GridWindow(vcl::Window* pParent); + explicit GridWindow(vcl::Window* pParent); void Init(double* pXValues, double* pYValues, int nValues, bool bCutValues, const BitmapEx &rMarkerBitmap); virtual ~GridWindow(); virtual void dispose() override; @@ -262,7 +262,6 @@ double GridWindow::findMinY() } - double GridWindow::findMaxX() { if( ! m_pXValues ) @@ -275,7 +274,6 @@ double GridWindow::findMaxX() } - double GridWindow::findMaxY() { if( ! m_pNewYValues ) @@ -288,7 +286,6 @@ double GridWindow::findMaxY() } - void GridWindow::computeExtremes() { if( m_nValues && m_pXValues && m_pOrigYValues ) @@ -311,7 +308,6 @@ void GridWindow::computeExtremes() } - Point GridWindow::transform( double x, double y ) { Point aRet; @@ -368,7 +364,6 @@ void GridWindow::computeChunk( double fMin, double fMax, double& fChunkOut, doub } - void GridWindow::computeNew() { if(2L == m_aHandles.size()) @@ -414,7 +409,6 @@ void GridWindow::computeNew() } - double GridWindow::interpolate( double x, double* pNodeX, @@ -525,9 +519,9 @@ void GridWindow::drawNew(vcl::RenderContext& rRenderContext) void GridWindow::drawHandles(vcl::RenderContext& rRenderContext) { - for(size_t i(0L); i < m_aHandles.size(); i++) + for(impHandle & rHandle : m_aHandles) { - m_aHandles[i].draw(rRenderContext, m_aMarkerBitmap); + rHandle.draw(rRenderContext, m_aMarkerBitmap); } } diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx index 1a32c9804f66..2179538abe41 100644 --- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx +++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx @@ -138,7 +138,7 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::Property Reference< XStyleFamiliesSupplier > xstylefamiliessupplier(mxDoc, UNO_QUERY); Reference< XStyleLoader > xstyleLoader (xstylefamiliessupplier->getStyleFamilies(), UNO_QUERY); if(xstyleLoader.is()){ - Sequence<css::beans::PropertyValue> pValue=xstyleLoader->getStyleLoaderOptions(); + Sequence<css::beans::PropertyValue> aValue = xstyleLoader->getStyleLoaderOptions(); //Load the Styles from the Template URL Supplied in the TypeDetection file if(!comphelper::isFileUrl(msTemplateName)) @@ -149,7 +149,7 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::Property msTemplateName=PathString.concat(msTemplateName); } - xstyleLoader->loadStylesFromURL(msTemplateName,pValue); + xstyleLoader->loadStylesFromURL(msTemplateName,aValue); } } diff --git a/filter/source/xsltfilter/OleHandler.cxx b/filter/source/xsltfilter/OleHandler.cxx index e0d083aef727..0c29016817ef 100644 --- a/filter/source/xsltfilter/OleHandler.cxx +++ b/filter/source/xsltfilter/OleHandler.cxx @@ -108,17 +108,17 @@ namespace XSLT return "Not Found:";// + streamName; } //The first four byte are the length of the uncompressed data - Sequence<sal_Int8> pLength(4); + Sequence<sal_Int8> aLength(4); Reference<XSeekable> xSeek(subStream, UNO_QUERY); xSeek->seek(0); //Get the uncompressed length - int readbytes = subStream->readBytes(pLength, 4); + int readbytes = subStream->readBytes(aLength, 4); if (4 != readbytes) { return "Can not read the length."; } - int oleLength = (pLength[0] << 0) + (pLength[1] << 8) - + (pLength[2] << 16) + (pLength[3] << 24); + int oleLength = (aLength[0] << 0) + (aLength[1] << 8) + + (aLength[2] << 16) + (aLength[3] << 24); Sequence<sal_Int8> content(oleLength); //Read all bytes. The compressed length should less then the uncompressed length readbytes = subStream->readBytes(content, oleLength); diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index 7511c34a8720..6cb89717e057 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -1674,10 +1674,10 @@ const FormulaToken* FormulaTokenIterator::PeekNextOperator() } if (!t && maStack.size() > 1) { - FormulaTokenIterator::Item pHere = maStack.back(); + FormulaTokenIterator::Item aHere = maStack.back(); maStack.pop_back(); t = PeekNextOperator(); - maStack.push_back(pHere); + maStack.push_back(aHere); } return t; } diff --git a/helpcompiler/source/HelpIndexer_main.cxx b/helpcompiler/source/HelpIndexer_main.cxx index 85ff29a39b9d..82822d897445 100644 --- a/helpcompiler/source/HelpIndexer_main.cxx +++ b/helpcompiler/source/HelpIndexer_main.cxx @@ -20,9 +20,9 @@ int main(int argc, char **argv) { try { - const std::string pLang("-lang"); - const std::string pModule("-mod"); - const std::string pDir("-dir"); + const std::string aLang("-lang"); + const std::string aModule("-mod"); + const std::string aDir("-dir"); std::string lang; std::string module; @@ -30,19 +30,19 @@ int main(int argc, char **argv) bool error = false; for (int i = 1; i < argc; ++i) { - if (pLang.compare(argv[i]) == 0) { + if (aLang.compare(argv[i]) == 0) { if (i + 1 < argc) { lang = argv[++i]; } else { error = true; } - } else if (pModule.compare(argv[i]) == 0) { + } else if (aModule.compare(argv[i]) == 0) { if (i + 1 < argc) { module = argv[++i]; } else { error = true; } - } else if (pDir.compare(argv[i]) == 0) { + } else if (aDir.compare(argv[i]) == 0) { if (i + 1 < argc) { dir = argv[++i]; } else { diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index a39ff9452a9d..b02ff5c12cec 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -954,43 +954,43 @@ void HwpReader::makeMasterStyles() int i; int nMax = hwpfile.getMaxSettedPage(); - std::deque<PageSetting> pSet(nMax + 1); + std::deque<PageSetting> aSet(nMax + 1); for( i = 0 ; i < hwpfile.getPageNumberCount() ; i++ ) { ShowPageNum *pn = hwpfile.getPageNumber(i); - pSet[pn->m_nPageNumber].pagenumber = pn; - pSet[pn->m_nPageNumber].bIsSet = true; + aSet[pn->m_nPageNumber].pagenumber = pn; + aSet[pn->m_nPageNumber].bIsSet = true; } for( i = 0 ; i < hwpfile.getHeaderFooterCount() ; i++ ) { HeaderFooter* hf = hwpfile.getHeaderFooter(i); - pSet[hf->m_nPageNumber].bIsSet = true; + aSet[hf->m_nPageNumber].bIsSet = true; if( hf->type == 0 ) // header { switch( hf->where ) { case 0 : - pSet[hf->m_nPageNumber].header = hf; - pSet[hf->m_nPageNumber].header_even = nullptr; - pSet[hf->m_nPageNumber].header_odd = nullptr; + aSet[hf->m_nPageNumber].header = hf; + aSet[hf->m_nPageNumber].header_even = nullptr; + aSet[hf->m_nPageNumber].header_odd = nullptr; break; case 1: - pSet[hf->m_nPageNumber].header_even = hf; - if( pSet[hf->m_nPageNumber].header ) + aSet[hf->m_nPageNumber].header_even = hf; + if( aSet[hf->m_nPageNumber].header ) { - pSet[hf->m_nPageNumber].header_odd = - pSet[hf->m_nPageNumber].header; - pSet[hf->m_nPageNumber].header = nullptr; + aSet[hf->m_nPageNumber].header_odd = + aSet[hf->m_nPageNumber].header; + aSet[hf->m_nPageNumber].header = nullptr; } break; case 2: - pSet[hf->m_nPageNumber].header_odd = hf; - if( pSet[hf->m_nPageNumber].header ) + aSet[hf->m_nPageNumber].header_odd = hf; + if( aSet[hf->m_nPageNumber].header ) { - pSet[hf->m_nPageNumber].header_even = - pSet[hf->m_nPageNumber].header; - pSet[hf->m_nPageNumber].header = nullptr; + aSet[hf->m_nPageNumber].header_even = + aSet[hf->m_nPageNumber].header; + aSet[hf->m_nPageNumber].header = nullptr; } break; } @@ -1000,26 +1000,26 @@ void HwpReader::makeMasterStyles() switch( hf->where ) { case 0 : - pSet[hf->m_nPageNumber].footer = hf; - pSet[hf->m_nPageNumber].footer_even = nullptr; - pSet[hf->m_nPageNumber].footer_odd = nullptr; + aSet[hf->m_nPageNumber].footer = hf; + aSet[hf->m_nPageNumber].footer_even = nullptr; + aSet[hf->m_nPageNumber].footer_odd = nullptr; break; case 1: - pSet[hf->m_nPageNumber].footer_even = hf; - if( pSet[hf->m_nPageNumber].footer ) + aSet[hf->m_nPageNumber].footer_even = hf; + if( aSet[hf->m_nPageNumber].footer ) { - pSet[hf->m_nPageNumber].footer_odd = - pSet[hf->m_nPageNumber].footer; - pSet[hf->m_nPageNumber].footer = nullptr; + aSet[hf->m_nPageNumber].footer_odd = + aSet[hf->m_nPageNumber].footer; + aSet[hf->m_nPageNumber].footer = nullptr; } break; case 2: - pSet[hf->m_nPageNumber].footer_odd = hf; - if( pSet[hf->m_nPageNumber].footer ) + aSet[hf->m_nPageNumber].footer_odd = hf; + if( aSet[hf->m_nPageNumber].footer ) { - pSet[hf->m_nPageNumber].footer_even = - pSet[hf->m_nPageNumber].footer; - pSet[hf->m_nPageNumber].footer = nullptr; + aSet[hf->m_nPageNumber].footer_even = + aSet[hf->m_nPageNumber].footer; + aSet[hf->m_nPageNumber].footer = nullptr; } break; } @@ -1046,47 +1046,47 @@ void HwpReader::makeMasterStyles() rstartEl("style:master-page", rList); pList->clear(); - if( pSet[i].bIsSet ) /* If you've changed the current setting */ + if( aSet[i].bIsSet ) /* If you've changed the current setting */ { - if( !pSet[i].pagenumber ){ + if( !aSet[i].pagenumber ){ if( pPrevSet && pPrevSet->pagenumber ) - pSet[i].pagenumber = pPrevSet->pagenumber; + aSet[i].pagenumber = pPrevSet->pagenumber; } - if( pSet[i].pagenumber ) + if( aSet[i].pagenumber ) { - if( pSet[i].pagenumber->where == 7 && pSet[i].header ) + if( aSet[i].pagenumber->where == 7 && aSet[i].header ) { - pSet[i].header_even = pSet[i].header; - pSet[i].header_odd = pSet[i].header; - pSet[i].header = nullptr; + aSet[i].header_even = aSet[i].header; + aSet[i].header_odd = aSet[i].header; + aSet[i].header = nullptr; } - if( pSet[i].pagenumber->where == 8 && pSet[i].footer ) + if( aSet[i].pagenumber->where == 8 && aSet[i].footer ) { - pSet[i].footer_even = pSet[i].footer; - pSet[i].footer_odd = pSet[i].footer; - pSet[i].footer = nullptr; + aSet[i].footer_even = aSet[i].footer; + aSet[i].footer_odd = aSet[i].footer; + aSet[i].footer = nullptr; } } - if( !pSet[i].header_even && pPrevSet && pPrevSet->header_even ) + if( !aSet[i].header_even && pPrevSet && pPrevSet->header_even ) { - pSet[i].header_even = pPrevSet->header_even; + aSet[i].header_even = pPrevSet->header_even; } - if( !pSet[i].header_odd && pPrevSet && pPrevSet->header_odd ) + if( !aSet[i].header_odd && pPrevSet && pPrevSet->header_odd ) { - pSet[i].header_odd = pPrevSet->header_odd; + aSet[i].header_odd = pPrevSet->header_odd; } - if( !pSet[i].footer_even && pPrevSet && pPrevSet->footer_even ) + if( !aSet[i].footer_even && pPrevSet && pPrevSet->footer_even ) { - pSet[i].footer_even = pPrevSet->footer_even; + aSet[i].footer_even = pPrevSet->footer_even; } - if( !pSet[i].footer_odd && pPrevSet && pPrevSet->footer_odd ) + if( !aSet[i].footer_odd && pPrevSet && pPrevSet->footer_odd ) { - pSet[i].footer_odd = pPrevSet->footer_odd; + aSet[i].footer_odd = pPrevSet->footer_odd; } - pPage = &pSet[i]; - pPrevSet = &pSet[i]; + pPage = &aSet[i]; + pPrevSet = &aSet[i]; } else if( pPrevSet ) /* If the previous setting exists */ { diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx index f824e0cc82fc..718902caba6f 100644 --- a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx +++ b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx @@ -26,7 +26,7 @@ #include "osl/thread.h" #include "rtl/ustring.hxx" #include "rtl/byteseq.hxx" -#include "jvmfwk/framework.h" +#include "jvmfwk/framework.hxx" static bool hasOption(char const * szOption, int argc, char** argv); @@ -51,7 +51,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) fprintf(stdout, HELP_TEXT);// default return 0; } - sal_Bool bEnabled = sal_False; + sal_Bool bEnabled = false; javaFrameworkError errcode = jfw_getEnabled( & bEnabled); if (errcode == JFW_E_NONE && !bEnabled) { @@ -64,8 +64,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) return -1; } - JavaInfo * pInfo = nullptr; - errcode = jfw_getSelectedJRE( & pInfo); + jfw::JavaInfoGuard aInfo; + errcode = jfw_getSelectedJRE(&aInfo.info); if (errcode != JFW_E_NONE && errcode != JFW_E_INVALID_SETTINGS) { @@ -73,19 +73,19 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) return -1; } - if (pInfo == nullptr) + if (aInfo.info == nullptr) { - if (!findAndSelect(&pInfo)) + if (!findAndSelect(&aInfo.info)) return -1; } else { //check if the JRE was not uninstalled - sal_Bool bExist = sal_False; - errcode = jfw_existJRE(pInfo, &bExist); + sal_Bool bExist = false; + errcode = jfw_existJRE(aInfo.info, &bExist); if (errcode == JFW_E_NONE) { - if (!bExist && !findAndSelect(&pInfo)) + if (!bExist && !findAndSelect(&aInfo.info)) return -1; } else @@ -95,9 +95,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) } } - OString sPaths = getLD_LIBRARY_PATH(pInfo->arVendorData); + OString sPaths = getLD_LIBRARY_PATH(aInfo.info->arVendorData); fprintf(stdout, "%s\n", sPaths.getStr()); - jfw_freeJavaInfo(pInfo); } catch (const std::exception&) { @@ -153,5 +152,4 @@ static bool findAndSelect(JavaInfo ** ppInfo) } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index d86abac0b189..1552585ff411 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -167,8 +167,8 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile file->Extract(); XMLHashMap* aXMLStrHM = file->GetStrings(); - static ResData pResData("",""); - pResData.sResTyp = "help"; + static ResData s_ResData("",""); + s_ResData.sResTyp = "help"; std::vector<OString> order = file->getOrder(); std::vector<OString>::iterator pos; @@ -184,10 +184,10 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile printf("DBG: sHelpFile = %s\n",sHelpFile.getStr() ); #endif - pResData.sGId = posm->first; - pResData.sFilename = sHelpFile; + s_ResData.sGId = posm->first; + s_ResData.sFilename = sHelpFile; - ProcessHelp( aLangHM , sLanguage, &pResData , pMergeDataFile ); + ProcessHelp( aLangHM , sLanguage, &s_ResData , pMergeDataFile ); } file->Write(sPath); diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx index 357e8d932c48..3de5ac9e3e04 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -283,15 +283,15 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM uno::Reference< XLinguServiceManager2 > xLngSvcMgr( GetLngSvcMgr_Impl() ); uno::Reference< XSpellChecker1 > xSpell; - OUString rTerm(qTerm); - OUString pTerm(qTerm); + OUString aRTerm(qTerm); + OUString aPTerm(qTerm); CapType ct = CapType::UNKNOWN; sal_Int32 stem = 0; sal_Int32 stem2 = 0; sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale ); - if (LinguIsUnspecified( nLanguage) || rTerm.isEmpty()) + if (LinguIsUnspecified( nLanguage) || aRTerm.isEmpty()) return noMeanings; if (!hasLocale( rLocale )) @@ -363,8 +363,8 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM { // convert word to all lower case for searching if (!stem) - ct = capitalType(rTerm, pCC); - OUString nTerm(makeLowerCase(rTerm, pCC)); + ct = capitalType(aRTerm, pCC); + OUString nTerm(makeLowerCase(aRTerm, pCC)); OString aTmp( OU2ENC(nTerm, eEnc) ); nmean = pTH->Lookup(aTmp.getStr(),aTmp.getLength(),&pmean); @@ -378,7 +378,7 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM if (stem) { xTmpRes2 = xSpell->spell( "<?xml?><query type='analyze'><word>" + - pTerm + "</word></query>", nLanguage, rProperties ); + aPTerm + "</word></query>", nLanguage, rProperties ); if (xTmpRes2.is()) { Sequence<OUString>seq = xTmpRes2->getAlternatives(); @@ -443,7 +443,7 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM OUString aAlt( cTerm + catst); pStr[i] = aAlt; } - Meaning * pMn = new Meaning(rTerm); + Meaning * pMn = new Meaning(aRTerm); OUString dTerm(pe->defn,strlen(pe->defn),eEnc ); pMn->SetMeaning(dTerm); pMn->SetSynonyms(aStr); @@ -471,31 +471,31 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM return noMeanings; Reference< XSpellAlternatives > xTmpRes; xTmpRes = xSpell->spell( "<?xml?><query type='stem'><word>" + - rTerm + "</word></query>", nLanguage, rProperties ); + aRTerm + "</word></query>", nLanguage, rProperties ); if (xTmpRes.is()) { Sequence<OUString>seq = xTmpRes->getAlternatives(); if (seq.getLength() > 0) { - rTerm = seq[0]; // XXX Use only the first stem + aRTerm = seq[0]; // XXX Use only the first stem continue; } } // stem the last word of the synonym (for categories after affixation) - rTerm = rTerm.trim(); - sal_Int32 pos = rTerm.lastIndexOf(' '); + aRTerm = aRTerm.trim(); + sal_Int32 pos = aRTerm.lastIndexOf(' '); if (!pos) return noMeanings; xTmpRes = xSpell->spell( "<?xml?><query type='stem'><word>" + - rTerm.copy(pos + 1) + "</word></query>", nLanguage, rProperties ); + aRTerm.copy(pos + 1) + "</word></query>", nLanguage, rProperties ); if (xTmpRes.is()) { Sequence<OUString>seq = xTmpRes->getAlternatives(); if (seq.getLength() > 0) { - pTerm = rTerm.copy(pos + 1); - rTerm = rTerm.copy(0, pos + 1) + seq[0]; + aPTerm = aRTerm.copy(pos + 1); + aRTerm = aRTerm.copy(0, pos + 1) + seq[0]; #if 0 for (int i = 0; i < seq.getLength(); i++) { diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 0f60082fb89f..e1288434db34 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -1656,12 +1656,12 @@ XFColumnSep* LwpLayout::GetColumnSep() return nullptr; } - LwpBorderStuff& pBorderStuff = pLayoutGutters->GetBorderStuff(); + LwpBorderStuff& rBorderStuff = pLayoutGutters->GetBorderStuff(); LwpBorderStuff::BorderType eType = LwpBorderStuff::LEFT; - LwpColor aColor = pBorderStuff.GetSideColor(eType); - double fWidth = pBorderStuff.GetSideWidth(eType); - //sal_uInt16 nType = pBorderStuff->GetSideType(eType); + LwpColor aColor = rBorderStuff.GetSideColor(eType); + double fWidth = rBorderStuff.GetSideWidth(eType); + //sal_uInt16 nType = rBorderStuff->GetSideType(eType); XFColumnSep* pColumnSep = new XFColumnSep(); XFColor aXFColor(aColor.To24Color()); diff --git a/mysqlc/source/mysqlc_databasemetadata.cxx b/mysqlc/source/mysqlc_databasemetadata.cxx index f7a49cfbe79c..8eca48a9aa55 100644 --- a/mysqlc/source/mysqlc_databasemetadata.cxx +++ b/mysqlc/source/mysqlc_databasemetadata.cxx @@ -1366,13 +1366,13 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures( std::string cat(catalog.hasValue()? rtl::OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""), sPattern(rtl::OUStringToOString(schemaPattern, m_rConnection.getConnectionEncoding()).getStr()), - pNamePattern(rtl::OUStringToOString(procedureNamePattern, m_rConnection.getConnectionEncoding()).getStr()); + procNamePattern(rtl::OUStringToOString(procedureNamePattern, m_rConnection.getConnectionEncoding()).getStr()); try { boost::scoped_ptr< sql::ResultSet> rset( meta->getProcedures(cat, sPattern.compare("")? sPattern:wild, - pNamePattern.compare("")? pNamePattern:wild)); + procNamePattern.compare("")? procNamePattern:wild)); rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding(); sql::ResultSetMetaData * rs_meta = rset->getMetaData(); @@ -1664,8 +1664,8 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges( Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference( const Any& primaryCatalog, - const rtl::OUString& primarySchema, - const rtl::OUString& primaryTable, + const rtl::OUString& primarySchema_, + const rtl::OUString& primaryTable_, const Any& foreignCatalog, const rtl::OUString& foreignSchema, const rtl::OUString& foreignTable) @@ -1677,14 +1677,14 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference( std::string primaryCat(primaryCatalog.hasValue()? rtl::OUStringToOString(getStringFromAny(primaryCatalog), m_rConnection.getConnectionEncoding()).getStr():""), foreignCat(foreignCatalog.hasValue()? rtl::OUStringToOString(getStringFromAny(foreignCatalog), m_rConnection.getConnectionEncoding()).getStr():""), - pSchema(rtl::OUStringToOString(primarySchema, m_rConnection.getConnectionEncoding()).getStr()), - pTable(rtl::OUStringToOString(primaryTable, m_rConnection.getConnectionEncoding()).getStr()), + primarySchema(rtl::OUStringToOString(primarySchema_, m_rConnection.getConnectionEncoding()).getStr()), + primaryTable(rtl::OUStringToOString(primaryTable_, m_rConnection.getConnectionEncoding()).getStr()), fSchema(rtl::OUStringToOString(foreignSchema, m_rConnection.getConnectionEncoding()).getStr()), fTable(rtl::OUStringToOString(foreignTable, m_rConnection.getConnectionEncoding()).getStr()); try { rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding(); - boost::scoped_ptr< sql::ResultSet> rset( meta->getCrossReference(primaryCat, pSchema, pTable, foreignCat, fSchema, fTable)); + boost::scoped_ptr< sql::ResultSet> rset( meta->getCrossReference(primaryCat, primarySchema, primaryTable, foreignCat, fSchema, fTable)); sql::ResultSetMetaData * rs_meta = rset->getMetaData(); sal_uInt32 columns = rs_meta->getColumnCount(); while (rset->next()) { diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 709c627db722..a2c3b9bf8203 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -794,8 +794,8 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP { OUStringBuffer buf; ::sax::Converter::convertDuration( buf, aDuration ); - OUString pDuration = buf.makeStringAndClear(); - writeElement( pAppProps, FSNS( XML_vt, XML_lpwstr ), pDuration ); + OUString aDurationStr = buf.makeStringAndClear(); + writeElement( pAppProps, FSNS( XML_vt, XML_lpwstr ), aDurationStr ); } else if ( ( aprop[n].Value ) >>= aDateTime ) writeElement( pAppProps, FSNS( XML_vt, XML_filetime ), aDateTime ); diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 1d0b78e82aeb..51b58da1a6aa 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -20,7 +20,6 @@ #include "diagramlayoutatoms.hxx" #include <functional> -#include <boost/bind.hpp> #include <osl/diagnose.h> #include <basegfx/numeric/ftools.hxx> @@ -84,9 +83,9 @@ void LayoutAtom::dump(int level) OSL_TRACE( "level = %d - %s of type %s", level, OUSTRING_TO_CSTR( msName ), typeid(*this).name() ); - const std::vector<LayoutAtomPtr>& pChildren=getChildren(); - std::for_each( pChildren.begin(), pChildren.end(), - boost::bind( &LayoutAtom::dump, _1, level + 1 ) ); + const std::vector<LayoutAtomPtr>& rChildren=getChildren(); + std::for_each( rChildren.begin(), rChildren.end(), + [level] (LayoutAtomPtr const& pAtom) { pAtom->dump(level + 1); } ); } ForEachAtom::ForEachAtom(const Reference< XFastAttributeList >& xAttributes) @@ -582,11 +581,9 @@ public: void ShapeCreationVisitor::defaultVisit(LayoutAtom& rAtom) { - const std::vector<LayoutAtomPtr>& pChildren=rAtom.getChildren(); - std::for_each( pChildren.begin(), pChildren.end(), - boost::bind( &LayoutAtom::accept, - _1, - boost::ref(*this)) ); + const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren(); + std::for_each( rChildren.begin(), rChildren.end(), + [this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } ); } void ShapeCreationVisitor::visit(ConstraintAtom& /*rAtom*/) @@ -601,7 +598,7 @@ void ShapeCreationVisitor::visit(AlgAtom& rAtom) void ShapeCreationVisitor::visit(ForEachAtom& rAtom) { - const std::vector<LayoutAtomPtr>& pChildren=rAtom.getChildren(); + const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren(); sal_Int32 nChildren=1; if( rAtom.iterator().mnPtType == XML_node ) @@ -610,10 +607,8 @@ void ShapeCreationVisitor::visit(ForEachAtom& rAtom) // attribute that is contained in diagram's // getPointsPresNameMap() ShallowPresNameVisitor aVisitor(mrDgm); - std::for_each( pChildren.begin(), pChildren.end(), - boost::bind( &LayoutAtom::accept, - _1, - boost::ref(aVisitor)) ); + std::for_each( rChildren.begin(), rChildren.end(), + [&] (LayoutAtomPtr const& pAtom) { pAtom->accept(aVisitor); } ); nChildren = aVisitor.getCount(); } @@ -626,10 +621,8 @@ void ShapeCreationVisitor::visit(ForEachAtom& rAtom) for( mnCurrIdx=0; mnCurrIdx<nCnt && nStep>0; mnCurrIdx+=nStep ) { // TODO there is likely some conditions - std::for_each( pChildren.begin(), pChildren.end(), - boost::bind( &LayoutAtom::accept, - _1, - boost::ref(*this)) ); + std::for_each( rChildren.begin(), rChildren.end(), + [this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } ); } // and restore idx @@ -695,11 +688,9 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom) void ShapeLayoutingVisitor::defaultVisit(LayoutAtom& rAtom) { // visit all children, one of them needs to be the layout algorithm - const std::vector<LayoutAtomPtr>& pChildren=rAtom.getChildren(); - std::for_each( pChildren.begin(), pChildren.end(), - boost::bind( &LayoutAtom::accept, - _1, - boost::ref(*this)) ); + const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren(); + std::for_each( rChildren.begin(), rChildren.end(), + [this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } ); } void ShapeLayoutingVisitor::visit(ConstraintAtom& /*rAtom*/) @@ -736,11 +727,9 @@ void ShallowPresNameVisitor::defaultVisit(LayoutAtom& rAtom) { // visit all children, at least one of them needs to have proper // name set - const std::vector<LayoutAtomPtr>& pChildren=rAtom.getChildren(); - std::for_each( pChildren.begin(), pChildren.end(), - boost::bind( &LayoutAtom::accept, - _1, - boost::ref(*this)) ); + const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren(); + std::for_each( rChildren.begin(), rChildren.end(), + [this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } ); } void ShallowPresNameVisitor::visit(ConstraintAtom& /*rAtom*/) diff --git a/oox/source/drawingml/effectproperties.cxx b/oox/source/drawingml/effectproperties.cxx index 3ec31e0f8b03..2dd529b834cb 100644 --- a/oox/source/drawingml/effectproperties.cxx +++ b/oox/source/drawingml/effectproperties.cxx @@ -73,9 +73,9 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap, css::beans::PropertyValue Effect::getEffect() { - css::beans::PropertyValue pRet; + css::beans::PropertyValue aRet; if( msName.isEmpty() ) - return pRet; + return aRet; css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() ); sal_uInt32 i = 0; @@ -86,10 +86,10 @@ css::beans::PropertyValue Effect::getEffect() i++; } - pRet.Name = msName; - pRet.Value = css::uno::Any( aSeq ); + aRet.Name = msName; + aRet.Value = css::uno::Any( aSeq ); - return pRet; + return aRet; } } // namespace drawingml diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index a667bc5a4b19..64b5cf355cec 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -772,9 +772,9 @@ bool ArtisticEffectProperties::isEmpty() const css::beans::PropertyValue ArtisticEffectProperties::getEffect() { - css::beans::PropertyValue pRet; + css::beans::PropertyValue aRet; if( msName.isEmpty() ) - return pRet; + return aRet; css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() + 1 ); sal_uInt32 i = 0; @@ -797,10 +797,10 @@ css::beans::PropertyValue ArtisticEffectProperties::getEffect() aSeq[i].Value = uno::makeAny( aGraphicSeq ); } - pRet.Name = msName; - pRet.Value = css::uno::Any( aSeq ); + aRet.Name = msName; + aRet.Value = css::uno::Any( aSeq ); - return pRet; + return aRet; } void ArtisticEffectProperties::assignUsed( const ArtisticEffectProperties& rSourceProps ) diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx index 397cabd2650d..5ecc2ecfaaa4 100644 --- a/oox/source/drawingml/textparagraphproperties.cxx +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -518,8 +518,8 @@ void TextParagraphProperties::dump() const xStart->gotoEnd( sal_True ); Reference< XPropertySet > xPropSet( xRange, UNO_QUERY ); pushToPropSet( nullptr, xPropSet, emptyMap, nullptr, false, 0 ); - PropertySet pSet( xPropSet ); - pSet.dump(); + PropertySet aPropSet( xPropSet ); + aPropSet.dump(); } #endif } } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 9c877574657b..9ac9c69d849c 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1765,12 +1765,12 @@ void DrawingML::WriteParagraphNumbering( Reference< XPropertySet > rXPropSet, sa FSEND ); } - OUString pAutoNumType = GetAutoNumType( nNumberingType, bSDot, bPBehind, bPBoth ); + OUString aAutoNumType = GetAutoNumType( nNumberingType, bSDot, bPBehind, bPBoth ); - if (!pAutoNumType.isEmpty()) + if (!aAutoNumType.isEmpty()) { mpFS->singleElementNS(XML_a, XML_buAutoNum, - XML_type, OUStringToOString(pAutoNumType, RTL_TEXTENCODING_UTF8).getStr(), + XML_type, OUStringToOString(aAutoNumType, RTL_TEXTENCODING_UTF8).getStr(), XML_startAt, nStartWith > 1 ? IS(nStartWith) : nullptr, FSEND); } diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx index c5ddf7654396..15925d911a60 100644 --- a/oox/source/ppt/timenodelistcontext.cxx +++ b/oox/source/ppt/timenodelistcontext.cxx @@ -433,9 +433,9 @@ namespace oox { namespace ppt { //xParentNode if( isCurrentElement( mnElement ) ) { - NodePropertyMap & pProps(mpNode->getNodeProperties()); - pProps[ NP_DIRECTION ] = makeAny( mnDir == XML_cw ); - pProps[ NP_COLORINTERPOLATION ] = makeAny( mnColorSpace == XML_hsl ? AnimationColorSpace::HSL : AnimationColorSpace::RGB ); + NodePropertyMap & rProps(mpNode->getNodeProperties()); + rProps[ NP_DIRECTION ] = makeAny( mnDir == XML_cw ); + rProps[ NP_COLORINTERPOLATION ] = makeAny( mnColorSpace == XML_hsl ? AnimationColorSpace::HSL : AnimationColorSpace::RGB ); const GraphicHelper& rGraphicHelper = getFilter().getGraphicHelper(); if( maToClr.isUsed() ) mpNode->setTo( Any( maToClr.getColor( rGraphicHelper ) ) ); diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx index ed6f304e6b58..6a64fef11390 100644 --- a/pyuno/source/module/pyuno_module.cxx +++ b/pyuno/source/module/pyuno_module.cxx @@ -173,11 +173,11 @@ static void fillStruct( for( int i = 0 ; i < remainingPosInitialisers && i < nMembers ; i ++ ) { const int tupleIndex = state.getCntConsumed(); - const OUString pMemberName (pCompType->ppMemberNames[i]); - state.setInitialised(pMemberName, tupleIndex); + const OUString& rMemberName (pCompType->ppMemberNames[i]); + state.setInitialised(rMemberName, tupleIndex); PyObject *element = PyTuple_GetItem( initializer, tupleIndex ); Any a = runtime.pyObject2Any( element, ACCEPT_UNO_ANY ); - inv->setValue( pMemberName, a ); + inv->setValue( rMemberName, a ); } } if ( PyTuple_Size( initializer ) > 0 ) diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index 221fd4cc893f..31d73177d1ca 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -1252,20 +1252,12 @@ namespace osl_FileStatus createTestDirectory( aTmpName3 ); createTestFile( aTmpName4 ); - Directory pDir( aTmpName3 ); - nError1 = pDir.open(); - CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 ); - nError1 = pDir.getNextItem( rItem ); - CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 ); - pDir.close(); - /* Directory aDir( aTmpName3 ); nError1 = aDir.open(); CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 ); - nError1 = aDir.getNextItem( rItem, 0 ); + nError1 = aDir.getNextItem( rItem ); CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 ); aDir.close(); - */ } void tearDown() override diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index e8f0f0a0e204..65e9fbce9cbf 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -6590,18 +6590,18 @@ void Test::testFormulaWizardSubformula() m_pDoc->SetString(ScAddress(1,1,0), "=1/0"); // B2 m_pDoc->SetString(ScAddress(1,2,0), "=gibberish"); // B3 - ScSimpleFormulaCalculator pFCell1( m_pDoc, ScAddress(0,0,0), "=B1:B3", true ); - sal_uInt16 nErrCode = pFCell1.GetErrCode(); - CPPUNIT_ASSERT( nErrCode == 0 || pFCell1.IsMatrix() ); - CPPUNIT_ASSERT_EQUAL( OUString("{1;#DIV/0!;#NAME?}"), pFCell1.GetString().getString() ); + ScSimpleFormulaCalculator aFCell1( m_pDoc, ScAddress(0,0,0), "=B1:B3", true ); + sal_uInt16 nErrCode = aFCell1.GetErrCode(); + CPPUNIT_ASSERT( nErrCode == 0 || aFCell1.IsMatrix() ); + CPPUNIT_ASSERT_EQUAL( OUString("{1;#DIV/0!;#NAME?}"), aFCell1.GetString().getString() ); m_pDoc->SetString(ScAddress(1,0,0), "=NA()"); // B1 m_pDoc->SetString(ScAddress(1,1,0), "2"); // B2 m_pDoc->SetString(ScAddress(1,2,0), "=1+2"); // B3 - ScSimpleFormulaCalculator pFCell2( m_pDoc, ScAddress(0,0,0), "=B1:B3", true ); - nErrCode = pFCell2.GetErrCode(); - CPPUNIT_ASSERT( nErrCode == 0 || pFCell2.IsMatrix() ); - CPPUNIT_ASSERT_EQUAL( OUString("{#N/A;2;3}"), pFCell2.GetString().getString() ); + ScSimpleFormulaCalculator aFCell2( m_pDoc, ScAddress(0,0,0), "=B1:B3", true ); + nErrCode = aFCell2.GetErrCode(); + CPPUNIT_ASSERT( nErrCode == 0 || aFCell2.IsMatrix() ); + CPPUNIT_ASSERT_EQUAL( OUString("{#N/A;2;3}"), aFCell2.GetString().getString() ); m_pDoc->DeleteTab(0); } diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index c70bf7188347..345020cba372 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -1095,9 +1095,9 @@ public: WalkElementBlocksMultipleValues(bool bTextAsZero, const std::vector<std::unique_ptr<_Op>>& aOp) : maOp(aOp), mbFirst(true), mbTextAsZero(bTextAsZero) { - for (const auto& pOp : maOp) + for (const auto& rpOp : maOp) { - maRes.emplace_back(pOp->mInitVal, pOp->mInitVal, 0); + maRes.emplace_back(rpOp->mInitVal, rpOp->mInitVal, 0); } maRes.emplace_back(0.0, 0.0, 0); // count } diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 3f826554411e..8e67c026e4c1 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -661,12 +661,12 @@ sal_uInt32 XclExpPaletteImpl::GetLeastUsedListColor() const for( sal_uInt32 nIdx = 0, nCount = mxColorList->size(); nIdx < nCount; ++nIdx ) { - XclListColor& pEntry = *mxColorList->at( nIdx ).get(); + XclListColor& rEntry = *mxColorList->at( nIdx ).get(); // ignore the base colors - if( !pEntry.IsBaseColor() && (pEntry.GetWeighting() < nMinW) ) + if( !rEntry.IsBaseColor() && (rEntry.GetWeighting() < nMinW) ) { nFound = nIdx; - nMinW = pEntry.GetWeighting(); + nMinW = rEntry.GetWeighting(); } } return nFound; diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 647728d92ef4..25e978c58d35 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2147,20 +2147,20 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt else { comphelper::ThreadPool &rPool = comphelper::ThreadPool::getSharedOptimalPool(); - std::vector<RowFinalizeTask*> pTasks(nThreads, nullptr); + std::vector<RowFinalizeTask*> aTasks(nThreads, nullptr); for ( size_t i = 0; i < nThreads; i++ ) - pTasks[ i ] = new RowFinalizeTask( rColXFIndexes, i == 0 ); + aTasks[ i ] = new RowFinalizeTask( rColXFIndexes, i == 0 ); RowMap::iterator itr, itrBeg = maRowMap.begin(), itrEnd = maRowMap.end(); size_t nIdx = 0; for ( itr = itrBeg; itr != itrEnd; ++itr, ++nIdx ) - pTasks[ nIdx % nThreads ]->push_back( itr->second.get() ); + aTasks[ nIdx % nThreads ]->push_back( itr->second.get() ); for ( size_t i = 1; i < nThreads; i++ ) - rPool.pushTask( pTasks[ i ] ); + rPool.pushTask( aTasks[ i ] ); // Progress bar updates must be synchronous to avoid deadlock - pTasks[0]->doWork(); + aTasks[0]->doWork(); rPool.waitUntilEmpty(); } diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index 72eec8a9024a..c65172c8d1b2 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -561,25 +561,25 @@ void ScPivotLayoutDialog::ApplyLabelData(ScDPSaveData& rSaveData) for (it = rLabelDataVector.begin(); it != rLabelDataVector.end(); ++it) { - const ScDPLabelData& pLabelData = *it->get(); + const ScDPLabelData& rLabelData = *it->get(); - OUString aUnoName = ScDPUtil::createDuplicateDimensionName(pLabelData.maName, pLabelData.mnDupCount); + OUString aUnoName = ScDPUtil::createDuplicateDimensionName(rLabelData.maName, rLabelData.mnDupCount); ScDPSaveDimension* pSaveDimensions = rSaveData.GetExistingDimensionByName(aUnoName); if (pSaveDimensions == nullptr) continue; - pSaveDimensions->SetUsedHierarchy(pLabelData.mnUsedHier); - pSaveDimensions->SetShowEmpty(pLabelData.mbShowAll); - pSaveDimensions->SetRepeatItemLabels(pLabelData.mbRepeatItemLabels); - pSaveDimensions->SetSortInfo(&pLabelData.maSortInfo); - pSaveDimensions->SetLayoutInfo(&pLabelData.maLayoutInfo); - pSaveDimensions->SetAutoShowInfo(&pLabelData.maShowInfo); + pSaveDimensions->SetUsedHierarchy(rLabelData.mnUsedHier); + pSaveDimensions->SetShowEmpty(rLabelData.mbShowAll); + pSaveDimensions->SetRepeatItemLabels(rLabelData.mbRepeatItemLabels); + pSaveDimensions->SetSortInfo(&rLabelData.maSortInfo); + pSaveDimensions->SetLayoutInfo(&rLabelData.maLayoutInfo); + pSaveDimensions->SetAutoShowInfo(&rLabelData.maShowInfo); - bool bManualSort = (pLabelData.maSortInfo.Mode == DataPilotFieldSortMode::MANUAL); + bool bManualSort = (rLabelData.maSortInfo.Mode == DataPilotFieldSortMode::MANUAL); std::vector<ScDPLabelData::Member>::const_iterator itMember; - for (itMember = pLabelData.maMembers.begin(); itMember != pLabelData.maMembers.end(); ++itMember) + for (itMember = rLabelData.maMembers.begin(); itMember != rLabelData.maMembers.end(); ++itMember) { const ScDPLabelData::Member& rLabelMember = *itMember; ScDPSaveMember* pMember = pSaveDimensions->GetMemberByName(rLabelMember.maName); diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx index 19697c4db490..3978f695a689 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.cxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx @@ -318,9 +318,9 @@ struct OpenCLTester mbOldAutoCalc = mpDoc->GetAutoCalc(); mpDoc->SetAutoCalc(false); mpOldCalcConfig = ScInterpreter::GetGlobalConfig(); - ScCalcConfig pConfig(mpOldCalcConfig); - pConfig.mnOpenCLMinimumFormulaGroupSize = 20; - ScInterpreter::SetGlobalConfig(pConfig); + ScCalcConfig aConfig(mpOldCalcConfig); + aConfig.mnOpenCLMinimumFormulaGroupSize = 20; + ScInterpreter::SetGlobalConfig(aConfig); mpDoc->SetString(ScAddress(0,0,0), "Result:"); } diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index a2cc775db2a7..49d62ba33b53 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -1188,8 +1188,8 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) const SfxPoolItem* pItem = nullptr; if ( rStyleSet.GetItemState( ATTR_PAGE_HEADERSET, false, &pItem ) == SfxItemState::SET ) { - const SfxItemSet& pHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet(); - Size aHeaderSize = static_cast<const SvxSizeItem&>(pHeaderSet.Get(ATTR_PAGE_SIZE)).GetSize(); + const SfxItemSet& rHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet(); + Size aHeaderSize = static_cast<const SvxSizeItem&>(rHeaderSet.Get(ATTR_PAGE_SIZE)).GetSize(); aHeaderSize.Height() = (long)( aButtonUpPt.Y() / HMM_PER_TWIPS + aOffset.Y() / HMM_PER_TWIPS - aULItem.GetUpper()); aHeaderSize.Height() = aHeaderSize.Height() * 100 / mnScale; SvxSetItem aNewHeader( static_cast<const SvxSetItem&>(rStyleSet.Get(ATTR_PAGE_HEADERSET)) ); @@ -1203,8 +1203,8 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) const SfxPoolItem* pItem = nullptr; if( rStyleSet.GetItemState( ATTR_PAGE_FOOTERSET, false, &pItem ) == SfxItemState::SET ) { - const SfxItemSet& pFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet(); - Size aFooterSize = static_cast<const SvxSizeItem&>(pFooterSet.Get(ATTR_PAGE_SIZE)).GetSize(); + const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet(); + Size aFooterSize = static_cast<const SvxSizeItem&>(rFooterSet.Get(ATTR_PAGE_SIZE)).GetSize(); aFooterSize.Height() = (long)( nHeight - aButtonUpPt.Y() / HMM_PER_TWIPS - aOffset.Y() / HMM_PER_TWIPS - aULItem.GetLower() ); aFooterSize.Height() = aFooterSize.Height() * 100 / mnScale; SvxSetItem aNewFooter( static_cast<const SvxSetItem&>(rStyleSet.Get(ATTR_PAGE_FOOTERSET)) ); diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 55ead626f149..5c03c169c891 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -251,11 +251,11 @@ void SdDrawDocument::UpdatePageRelativeURLs(const OUString& rOldName, const OUSt if (rNewName.isEmpty()) return; - SfxItemPool& pPool(GetPool()); - sal_uInt32 nCount = pPool.GetItemCount2(EE_FEATURE_FIELD); + SfxItemPool& rPool(GetPool()); + sal_uInt32 nCount = rPool.GetItemCount2(EE_FEATURE_FIELD); for (sal_uInt32 nOff = 0; nOff < nCount; nOff++) { - const SfxPoolItem *pItem = pPool.GetItem2(EE_FEATURE_FIELD, nOff); + const SfxPoolItem *pItem = rPool.GetItem2(EE_FEATURE_FIELD, nOff); const SvxFieldItem* pFldItem = dynamic_cast< const SvxFieldItem * > (pItem); if(pFldItem) @@ -295,11 +295,11 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_ { bool bNotes = (pPage->GetPageKind() == PK_NOTES); - SfxItemPool& pPool(GetPool()); - sal_uInt32 nCount = pPool.GetItemCount2(EE_FEATURE_FIELD); + SfxItemPool& rPool(GetPool()); + sal_uInt32 nCount = rPool.GetItemCount2(EE_FEATURE_FIELD); for (sal_uInt32 nOff = 0; nOff < nCount; nOff++) { - const SfxPoolItem *pItem = pPool.GetItem2(EE_FEATURE_FIELD, nOff); + const SfxPoolItem *pItem = rPool.GetItem2(EE_FEATURE_FIELD, nOff); const SvxFieldItem* pFldItem; if ((pFldItem = dynamic_cast< const SvxFieldItem * > (pItem)) != nullptr) diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx index 40fe770c9929..bd3704be59a9 100644 --- a/sd/source/ui/dlg/morphdlg.cxx +++ b/sd/source/ui/dlg/morphdlg.cxx @@ -45,9 +45,9 @@ MorphDlg::MorphDlg( vcl::Window* pParent, const SdrObject* pObj1, const SdrObjec LoadSettings(); - SfxItemPool & pPool = pObj1->GetObjectItemPool(); - SfxItemSet aSet1( pPool ); - SfxItemSet aSet2( pPool ); + SfxItemPool & rPool = pObj1->GetObjectItemPool(); + SfxItemSet aSet1( rPool ); + SfxItemSet aSet2( rPool ); aSet1.Put(pObj1->GetMergedItemSet()); aSet2.Put(pObj2->GetMergedItemSet()); diff --git a/sd/source/ui/func/fuchar.cxx b/sd/source/ui/func/fuchar.cxx index c0131037786c..5fc88f4a9161 100644 --- a/sd/source/ui/func/fuchar.cxx +++ b/sd/source/ui/func/fuchar.cxx @@ -109,19 +109,19 @@ void FuChar::DoExecute( SfxRequest& rReq ) if( nResult == RET_OK ) { const SfxItemSet* pOutputSet = pDlg->GetOutputItemSet(); - SfxItemSet pOtherSet( *pOutputSet ); + SfxItemSet aOtherSet( *pOutputSet ); // and now the reverse process - const SvxBrushItem* pBrushItem= static_cast<const SvxBrushItem*>(pOtherSet.GetItem( SID_ATTR_BRUSH_CHAR )); + const SvxBrushItem* pBrushItem= static_cast<const SvxBrushItem*>(aOtherSet.GetItem( SID_ATTR_BRUSH_CHAR )); if ( pBrushItem ) { SvxBackgroundColorItem aBackColorItem( pBrushItem->GetColor(), EE_CHAR_BKGCOLOR ); - pOtherSet.ClearItem( SID_ATTR_BRUSH_CHAR ); - pOtherSet.Put( aBackColorItem ); + aOtherSet.ClearItem( SID_ATTR_BRUSH_CHAR ); + aOtherSet.Put( aBackColorItem ); } - rReq.Done( pOtherSet ); + rReq.Done( aOtherSet ); pArgs = rReq.GetArgs(); } } diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index bede93a36388..46893b6fc2f2 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -342,14 +342,14 @@ void FuMorph::ImpInsertPolygons( long nStartLineWidth = 0; long nEndLineWidth = 0; SdrPageView* pPageView = mpView->GetSdrPageView(); - SfxItemPool & pPool = pObj1->GetObjectItemPool(); - SfxItemSet aSet1( pPool,SDRATTR_START,SDRATTR_NOTPERSIST_FIRST-1,EE_ITEMS_START,EE_ITEMS_END,0 ); + SfxItemPool & rPool = pObj1->GetObjectItemPool(); + SfxItemSet aSet1( rPool,SDRATTR_START,SDRATTR_NOTPERSIST_FIRST-1,EE_ITEMS_START,EE_ITEMS_END,0 ); SfxItemSet aSet2( aSet1 ); - bool bLineColor = false; - bool bFillColor = false; - bool bLineWidth = false; - bool bIgnoreLine = false; - bool bIgnoreFill = false; + bool bLineColor = false; + bool bFillColor = false; + bool bLineWidth = false; + bool bIgnoreLine = false; + bool bIgnoreFill = false; aSet1.Put(pObj1->GetMergedItemSet()); aSet2.Put(pObj2->GetMergedItemSet()); diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx index a2a845495c1a..d76311c37a15 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx @@ -86,34 +86,34 @@ namespace std::vector<char> lcl_escapeLineFeeds(const char* const i_pStr) { size_t nLength(strlen(i_pStr)); - std::vector<char> pBuffer; - pBuffer.reserve(2*nLength+1); + std::vector<char> aBuffer; + aBuffer.reserve(2*nLength+1); const char* pRead = i_pStr; while( nLength-- ) { if( *pRead == '\r' ) { - pBuffer.push_back('\\'); - pBuffer.push_back('r'); + aBuffer.push_back('\\'); + aBuffer.push_back('r'); } else if( *pRead == '\n' ) { - pBuffer.push_back('\\'); - pBuffer.push_back('n'); + aBuffer.push_back('\\'); + aBuffer.push_back('n'); } else if( *pRead == '\\' ) { - pBuffer.push_back('\\'); - pBuffer.push_back('\\'); + aBuffer.push_back('\\'); + aBuffer.push_back('\\'); } else - pBuffer.push_back(*pRead); + aBuffer.push_back(*pRead); pRead++; } - pBuffer.push_back(0); + aBuffer.push_back(0); - return pBuffer; + return aBuffer; } } @@ -574,14 +574,14 @@ void PDFOutDev::processLink(Link* link, Catalog*) { const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->getCString(); - std::vector<char> pEsc( lcl_escapeLineFeeds(pURI) ); + std::vector<char> aEsc( lcl_escapeLineFeeds(pURI) ); printf( "drawLink %f %f %f %f %s\n", normalize(x1), normalize(y1), normalize(x2), normalize(y2), - pEsc.data() ); + aEsc.data() ); } } @@ -767,7 +767,7 @@ void PDFOutDev::updateFont(GfxState *state) aFont = it->second; - std::vector<char> pEsc( lcl_escapeLineFeeds(aFont.familyName.getCString()) ); + std::vector<char> aEsc( lcl_escapeLineFeeds(aFont.familyName.getCString()) ); printf( " %d %d %d %d %f %d %s", aFont.isEmbedded, aFont.isBold, @@ -775,7 +775,7 @@ void PDFOutDev::updateFont(GfxState *state) aFont.isUnderline, normalize(state->getTransformedFontSize()), nEmbedSize, - pEsc.data() ); + aEsc.data() ); } printf( "\n" ); @@ -920,8 +920,8 @@ void PDFOutDev::drawChar(GfxState *state, double x, double y, for( int i=0; i<uLen; ++i ) { buf[ m_pUtf8Map->mapUnicode(u[i], buf, sizeof(buf)-1) ] = 0; - std::vector<char> pEsc( lcl_escapeLineFeeds(buf) ); - printf( "%s", pEsc.data() ); + std::vector<char> aEsc( lcl_escapeLineFeeds(buf) ); + printf( "%s", aEsc.data() ); } printf( "\n" ); diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 3119d6df5a3e..2cc7a4a28379 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -602,7 +602,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( !pFileNameItem ) { // get FileName from dialog - std::vector<OUString> pURLList; + std::vector<OUString> aURLList; OUString aFilter; SfxItemSet* pSet = nullptr; OUString aPath; @@ -640,12 +640,12 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) sal_uIntPtr nErr = sfx2::FileOpenDialog_Impl( ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, - SFXWB_MULTISELECTION, OUString(), pURLList, + SFXWB_MULTISELECTION, OUString(), aURLList, aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList ); if ( nErr == ERRCODE_ABORT ) { - pURLList.clear(); + aURLList.clear(); return; } @@ -656,7 +656,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) rReq.AppendItem( SfxStringItem( SID_REFERER, "private:user" ) ); delete pSet; - if(!pURLList.empty()) + if(!aURLList.empty()) { if ( nSID == SID_OPENTEMPLATE ) rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, false ) ); @@ -693,7 +693,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) rReq.AppendItem(SfxStringItem(SID_DOC_SERVICE, aDocService)); } - for(std::vector<OUString>::const_iterator i = pURLList.begin(); i != pURLList.end(); ++i) + for(std::vector<OUString>::const_iterator i = aURLList.begin(); i != aURLList.end(); ++i) { rReq.RemoveItem( SID_FILE_NAME ); rReq.AppendItem( SfxStringItem( SID_FILE_NAME, *i ) ); @@ -725,10 +725,10 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } } - pURLList.clear(); + aURLList.clear(); return; } - pURLList.clear(); + aURLList.clear(); } bool bHyperlinkUsed = false; diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 1b905000c89f..8d7f161997d3 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -1936,27 +1936,27 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, SfxPoolItem* &rpState ) else { css::uno::Any aAny = pBind->GetStatus().State; - css::uno::Type pType = aAny.getValueType(); + css::uno::Type aType = aAny.getValueType(); - if ( pType == cppu::UnoType<bool>::get() ) + if ( aType == cppu::UnoType<bool>::get() ) { bool bTemp = false; aAny >>= bTemp ; pItem = new SfxBoolItem( nSlot, bTemp ); } - else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) + else if ( aType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 nTemp = 0; aAny >>= nTemp ; pItem = new SfxUInt16Item( nSlot, nTemp ); } - else if ( pType == cppu::UnoType<sal_uInt32>::get() ) + else if ( aType == cppu::UnoType<sal_uInt32>::get() ) { sal_uInt32 nTemp = 0; aAny >>= nTemp ; pItem = new SfxUInt32Item( nSlot, nTemp ); } - else if ( pType == cppu::UnoType<OUString>::get() ) + else if ( aType == cppu::UnoType<OUString>::get() ) { OUString sTemp ; aAny >>= sTemp ; diff --git a/sfx2/source/control/querystatus.cxx b/sfx2/source/control/querystatus.cxx index a49315143c6c..aea4c8f01ff8 100644 --- a/sfx2/source/control/querystatus.cxx +++ b/sfx2/source/control/querystatus.cxx @@ -109,40 +109,40 @@ throw( RuntimeException, std::exception ) if ( rEvent.IsEnabled ) { m_eState = SfxItemState::DEFAULT; - css::uno::Type pType = rEvent.State.getValueType(); + css::uno::Type aType = rEvent.State.getValueType(); - if ( pType == cppu::UnoType<bool>::get() ) + if ( aType == cppu::UnoType<bool>::get() ) { bool bTemp = false; rEvent.State >>= bTemp ; m_pItem = new SfxBoolItem( m_nSlotID, bTemp ); } - else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) + else if ( aType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 nTemp = 0; rEvent.State >>= nTemp ; m_pItem = new SfxUInt16Item( m_nSlotID, nTemp ); } - else if ( pType == cppu::UnoType<sal_uInt32>::get() ) + else if ( aType == cppu::UnoType<sal_uInt32>::get() ) { sal_uInt32 nTemp = 0; rEvent.State >>= nTemp ; m_pItem = new SfxUInt32Item( m_nSlotID, nTemp ); } - else if ( pType == cppu::UnoType<OUString>::get() ) + else if ( aType == cppu::UnoType<OUString>::get() ) { OUString sTemp ; rEvent.State >>= sTemp ; m_pItem = new SfxStringItem( m_nSlotID, sTemp ); } - else if ( pType == cppu::UnoType< css::frame::status::ItemStatus>::get() ) + else if ( aType == cppu::UnoType< css::frame::status::ItemStatus>::get() ) { ItemStatus aItemStatus; rEvent.State >>= aItemStatus; m_eState = (SfxItemState) aItemStatus.State; m_pItem = new SfxVoidItem( m_nSlotID ); } - else if ( pType == cppu::UnoType< css::frame::status::Visibility>::get() ) + else if ( aType == cppu::UnoType< css::frame::status::Visibility>::get() ) { Visibility aVisibilityStatus; rEvent.State >>= aVisibilityStatus; diff --git a/sfx2/source/control/sfxstatuslistener.cxx b/sfx2/source/control/sfxstatuslistener.cxx index 4e6567ecb186..dab426adf6b2 100644 --- a/sfx2/source/control/sfxstatuslistener.cxx +++ b/sfx2/source/control/sfxstatuslistener.cxx @@ -168,45 +168,45 @@ throw( RuntimeException, std::exception ) if ( rEvent.IsEnabled ) { eState = SfxItemState::DEFAULT; - css::uno::Type pType = rEvent.State.getValueType(); + css::uno::Type aType = rEvent.State.getValueType(); - if ( pType == ::cppu::UnoType<void>::get() ) + if ( aType == ::cppu::UnoType<void>::get() ) { pItem = new SfxVoidItem( m_nSlotID ); eState = SfxItemState::UNKNOWN; } - else if ( pType == cppu::UnoType< bool >::get() ) + else if ( aType == cppu::UnoType< bool >::get() ) { bool bTemp = false; rEvent.State >>= bTemp ; pItem = new SfxBoolItem( m_nSlotID, bTemp ); } - else if ( pType == cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) + else if ( aType == cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt16Item( m_nSlotID, nTemp ); } - else if ( pType == cppu::UnoType<sal_uInt32>::get() ) + else if ( aType == cppu::UnoType<sal_uInt32>::get() ) { sal_uInt32 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt32Item( m_nSlotID, nTemp ); } - else if ( pType == cppu::UnoType<OUString>::get() ) + else if ( aType == cppu::UnoType<OUString>::get() ) { OUString sTemp ; rEvent.State >>= sTemp ; pItem = new SfxStringItem( m_nSlotID, sTemp ); } - else if ( pType == cppu::UnoType< css::frame::status::ItemStatus >::get() ) + else if ( aType == cppu::UnoType< css::frame::status::ItemStatus >::get() ) { ItemStatus aItemStatus; rEvent.State >>= aItemStatus; eState = (SfxItemState) aItemStatus.State; pItem = new SfxVoidItem( m_nSlotID ); } - else if ( pType == cppu::UnoType< css::frame::status::Visibility >::get() ) + else if ( aType == cppu::UnoType< css::frame::status::Visibility >::get() ) { Visibility aVisibilityStatus; rEvent.State >>= aVisibilityStatus; diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index b0fd28be36e4..eb8550da93ca 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -95,26 +95,26 @@ void SAL_CALL BindDispatch_Impl::statusChanged( const css::frame::FeatureStateE eState = SfxItemState::DEFAULT; css::uno::Any aAny = aStatus.State; - css::uno::Type pType = aAny.getValueType(); - if ( pType == cppu::UnoType< bool >::get() ) + css::uno::Type aType = aAny.getValueType(); + if ( aType == cppu::UnoType< bool >::get() ) { bool bTemp = false; aAny >>= bTemp ; pItem = new SfxBoolItem( nId, bTemp ); } - else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) + else if ( aType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 nTemp = 0; aAny >>= nTemp ; pItem = new SfxUInt16Item( nId, nTemp ); } - else if ( pType == cppu::UnoType<sal_uInt32>::get() ) + else if ( aType == cppu::UnoType<sal_uInt32>::get() ) { sal_uInt32 nTemp = 0; aAny >>= nTemp ; pItem = new SfxUInt32Item( nId, nTemp ); } - else if ( pType == cppu::UnoType<OUString>::get() ) + else if ( aType == cppu::UnoType<OUString>::get() ) { OUString sTemp ; aAny >>= sTemp ; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index c67048e3b6a0..d9462ba16962 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -152,27 +152,27 @@ void SAL_CALL SfxUnoControllerItem::statusChanged(const css::frame::FeatureState if ( rEvent.IsEnabled ) { eState = SfxItemState::DEFAULT; - css::uno::Type pType = rEvent.State.getValueType(); + css::uno::Type aType = rEvent.State.getValueType(); - if ( pType == cppu::UnoType< bool >::get() ) + if ( aType == cppu::UnoType< bool >::get() ) { bool bTemp = false; rEvent.State >>= bTemp ; pItem = new SfxBoolItem( pCtrlItem->GetId(), bTemp ); } - else if ( pType == cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) + else if ( aType == cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt16Item( pCtrlItem->GetId(), nTemp ); } - else if ( pType == cppu::UnoType<sal_uInt32>::get() ) + else if ( aType == cppu::UnoType<sal_uInt32>::get() ) { sal_uInt32 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt32Item( pCtrlItem->GetId(), nTemp ); } - else if ( pType == cppu::UnoType<OUString>::get() ) + else if ( aType == cppu::UnoType<OUString>::get() ) { OUString sTemp ; rEvent.State >>= sTemp ; diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 00409025f21e..43d8cd6e8019 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -177,14 +177,14 @@ OUString ConvertDateTime_Impl( const OUString& rName, { Date aD(uDT); tools::Time aT(uDT); - const OUString pDelim ( ", " ); + const OUString aDelim( ", " ); OUString aStr( rWrapper.getDate( aD ) ); - aStr += pDelim; + aStr += aDelim; aStr += rWrapper.getTime( aT ); OUString aAuthor = comphelper::string::stripStart(rName, ' '); if (!aAuthor.isEmpty()) { - aStr += pDelim; + aStr += aDelim; aStr += aAuthor; } return aStr; diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 64c18419cb9c..e1d4ec319992 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -795,10 +795,10 @@ bool ModelData_Impl::CheckFilterOptionsDialogExistence() while ( xFilterEnum->hasMoreElements() ) { - uno::Sequence< beans::PropertyValue > pProps; - if ( xFilterEnum->nextElement() >>= pProps ) + uno::Sequence< beans::PropertyValue > aProps; + if ( xFilterEnum->nextElement() >>= aProps ) { - ::comphelper::SequenceAsHashMap aPropsHM( pProps ); + ::comphelper::SequenceAsHashMap aPropsHM( aProps ); OUString aUIServName = aPropsHM.getUnpackedValueOrDefault( "UIComponent", OUString() ); diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 4b3b9c042f4f..beb29f7ba162 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -255,38 +255,38 @@ throw ( css::uno::RuntimeException, std::exception ) if ( rEvent.IsEnabled ) { eState = SfxItemState::DEFAULT; - uno::Type pType = rEvent.State.getValueType(); + uno::Type aType = rEvent.State.getValueType(); - if ( pType == cppu::UnoType<void>::get() ) + if ( aType == cppu::UnoType<void>::get() ) { pItem = new SfxVoidItem( nSlotID ); eState = SfxItemState::UNKNOWN; } - else if ( pType == cppu::UnoType<bool>::get() ) + else if ( aType == cppu::UnoType<bool>::get() ) { bool bTemp = false; rEvent.State >>= bTemp ; pItem = new SfxBoolItem( nSlotID, bTemp ); } - else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) + else if ( aType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt16Item( nSlotID, nTemp ); } - else if ( pType == cppu::UnoType<sal_uInt32>::get() ) + else if ( aType == cppu::UnoType<sal_uInt32>::get() ) { sal_uInt32 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt32Item( nSlotID, nTemp ); } - else if ( pType == cppu::UnoType<OUString>::get() ) + else if ( aType == cppu::UnoType<OUString>::get() ) { OUString sTemp ; rEvent.State >>= sTemp ; pItem = new SfxStringItem( nSlotID, sTemp ); } - else if ( pType == cppu::UnoType< css::frame::status::ItemStatus>::get() ) + else if ( aType == cppu::UnoType< css::frame::status::ItemStatus>::get() ) { frame::status::ItemStatus aItemStatus; rEvent.State >>= aItemStatus; diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 92627966c7c0..08bd90474870 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -483,38 +483,38 @@ throw ( css::uno::RuntimeException, std::exception ) if ( rEvent.IsEnabled ) { eState = SfxItemState::DEFAULT; - css::uno::Type pType = rEvent.State.getValueType(); + css::uno::Type aType = rEvent.State.getValueType(); - if ( pType == cppu::UnoType<void>::get() ) + if ( aType == cppu::UnoType<void>::get() ) { pItem = new SfxVoidItem( nSlotId ); eState = SfxItemState::UNKNOWN; } - else if ( pType == cppu::UnoType<bool>::get() ) + else if ( aType == cppu::UnoType<bool>::get() ) { bool bTemp = false; rEvent.State >>= bTemp ; pItem = new SfxBoolItem( nSlotId, bTemp ); } - else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()) + else if ( aType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()) { sal_uInt16 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt16Item( nSlotId, nTemp ); } - else if ( pType == cppu::UnoType<sal_uInt32>::get() ) + else if ( aType == cppu::UnoType<sal_uInt32>::get() ) { sal_uInt32 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt32Item( nSlotId, nTemp ); } - else if ( pType == cppu::UnoType<OUString>::get() ) + else if ( aType == cppu::UnoType<OUString>::get() ) { OUString sTemp ; rEvent.State >>= sTemp ; pItem = new SfxStringItem( nSlotId, sTemp ); } - else if ( pType == cppu::UnoType< css::frame::status::ItemStatus>::get() ) + else if ( aType == cppu::UnoType< css::frame::status::ItemStatus>::get() ) { ItemStatus aItemStatus; rEvent.State >>= aItemStatus; @@ -527,7 +527,7 @@ throw ( css::uno::RuntimeException, std::exception ) eState = tmpState; pItem = new SfxVoidItem( nSlotId ); } - else if ( pType == cppu::UnoType< css::frame::status::Visibility>::get() ) + else if ( aType == cppu::UnoType< css::frame::status::Visibility>::get() ) { Visibility aVisibilityStatus; rEvent.State >>= aVisibilityStatus; @@ -825,38 +825,38 @@ throw ( css::uno::RuntimeException, std::exception ) if ( rEvent.IsEnabled ) { eState = SfxItemState::DEFAULT; - css::uno::Type pType = rEvent.State.getValueType(); + css::uno::Type aType = rEvent.State.getValueType(); - if ( pType == cppu::UnoType<void>::get() ) + if ( aType == cppu::UnoType<void>::get() ) { pItem = new SfxVoidItem( nSlotId ); eState = SfxItemState::UNKNOWN; } - else if ( pType == cppu::UnoType<bool>::get() ) + else if ( aType == cppu::UnoType<bool>::get() ) { bool bTemp = false; rEvent.State >>= bTemp ; pItem = new SfxBoolItem( nSlotId, bTemp ); } - else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()) + else if ( aType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()) { sal_uInt16 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt16Item( nSlotId, nTemp ); } - else if ( pType == cppu::UnoType<sal_uInt32>::get() ) + else if ( aType == cppu::UnoType<sal_uInt32>::get() ) { sal_uInt32 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt32Item( nSlotId, nTemp ); } - else if ( pType == cppu::UnoType<OUString>::get() ) + else if ( aType == cppu::UnoType<OUString>::get() ) { OUString sTemp ; rEvent.State >>= sTemp ; pItem = new SfxStringItem( nSlotId, sTemp ); } - else if ( pType == cppu::UnoType< css::frame::status::ItemStatus>::get() ) + else if ( aType == cppu::UnoType< css::frame::status::ItemStatus>::get() ) { ItemStatus aItemStatus; rEvent.State >>= aItemStatus; @@ -869,7 +869,7 @@ throw ( css::uno::RuntimeException, std::exception ) eState = tmpState; pItem = new SfxVoidItem( nSlotId ); } - else if ( pType == cppu::UnoType< css::frame::status::Visibility>::get() ) + else if ( aType == cppu::UnoType< css::frame::status::Visibility>::get() ) { Visibility aVisibilityStatus; rEvent.State >>= aVisibilityStatus; diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx b/slideshow/source/engine/shapes/drawshapesubsetting.cxx index 183eaadf89a8..3a62136209e4 100644 --- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx +++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx @@ -398,8 +398,8 @@ namespace slideshow // the whole shape set // determine new subset range - for( const auto& pShape : maSubsetShapes ) - updateSubsetBounds( pShape ); + for( const auto& rSubsetShape : maSubsetShapes ) + updateSubsetBounds( rSubsetShape ); updateSubsets(); diff --git a/slideshow/source/engine/transitions/slidechangebase.cxx b/slideshow/source/engine/transitions/slidechangebase.cxx index 07ca4eb8b20b..a1209371efc4 100644 --- a/slideshow/source/engine/transitions/slidechangebase.cxx +++ b/slideshow/source/engine/transitions/slidechangebase.cxx @@ -446,12 +446,12 @@ void SlideChangeBase::viewsChanged() if( mbFinished ) return; - for( auto& pView : maViewData ) + for( auto& rView : maViewData ) { // clear stale info (both bitmaps and sprites prolly need a // resize) - clearViewEntry( pView ); - addSprites( pView ); + clearViewEntry( rView ); + addSprites( rView ); } } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 8428604e3169..84db648fecab 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -842,9 +842,9 @@ sal_uInt64 UCBStorageStream_Impl::ReadSourceWriteTemporary(sal_uInt64 aLength) sal_uLong aReaded = 32000; - for (sal_uInt64 pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000) + for (sal_uInt64 nInd = 0; nInd < aLength && aReaded == 32000 ; nInd += 32000) { - sal_uLong aToCopy = min( aLength - pInd, 32000 ); + sal_uLong aToCopy = min( aLength - nInd, 32000 ); aReaded = m_rSource->readBytes( aData, aToCopy ); aResult += m_pStream->Write( aData.getArray(), aReaded ); } diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index 8efa9315ea79..3fbe7a74a80d 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -717,9 +717,9 @@ void SmCursor::InsertBrackets(SmBracketType eBracketType) { //Insert into line pLineList->insert(it, pBrace); //Patch line (I think this is good enough) - SmCaretPos pAfter = PatchLineList(pLineList, it); + SmCaretPos aAfter = PatchLineList(pLineList, it); if( !PosAfterInsert.IsValid() ) - PosAfterInsert = pAfter; + PosAfterInsert = aAfter; //Finish editing FinishEdit(pLineList, pLineParent, nParentIndex, PosAfterInsert); diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index 640c1e2a75b7..ea997fba8243 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -210,9 +210,9 @@ void SmCaretDrawingVisitor::Visit( SmTextNode* pNode ) } //Underline the line - Point pLeft( left_line, top + height ); - Point pRight( right_line, top + height ); - rDev.DrawLine( pLeft, pRight ); + Point aLeft( left_line, top + height ); + Point aRight( right_line, top + height ); + rDev.DrawLine( aLeft, aRight ); } void SmCaretDrawingVisitor::DefaultVisit( SmNode* pNode ) @@ -240,9 +240,9 @@ void SmCaretDrawingVisitor::DefaultVisit( SmNode* pNode ) } //Underline the line - Point pLeft( left_line, top + height ); - Point pRight( right_line, top + height ); - rDev.DrawLine( pLeft, pRight ); + Point aLeft( left_line, top + height ); + Point aRight( right_line, top + height ); + rDev.DrawLine( aLeft, aRight ); } // SmCaretPos2LineVisitor diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index e24ea4c5b07c..e37023b1d191 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -70,7 +70,7 @@ #include <sal/types.h> #include <uno/current_context.hxx> #include <uno/environment.h> -#include <jvmfwk/framework.h> +#include <jvmfwk/framework.hxx> #include "jni.h" #include <stack> @@ -78,7 +78,6 @@ #include <time.h> #include <memory> #include <vector> -#include <boost/noncopyable.hpp> // Properties of the javavm can be put // as a komma separated list in this @@ -112,14 +111,12 @@ using stoc_javavm::JavaVirtualMachine; namespace { - class NoJavaIniException: public css::uno::Exception { }; class SingletonFactory: - private cppu::WeakImplHelper< css::lang::XEventListener >, - private boost::noncopyable + private cppu::WeakImplHelper< css::lang::XEventListener > { public: static css::uno::Reference< css::uno::XInterface > getSingleton( @@ -130,6 +127,9 @@ private: virtual inline ~SingletonFactory() {} + SingletonFactory(const SingletonFactory&) = delete; + SingletonFactory& operator=(const SingletonFactory&) = delete; + virtual void SAL_CALL disposing(css::lang::EventObject const &) throw (css::uno::RuntimeException, std::exception) override; @@ -276,7 +276,7 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm, css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple(xConfRegistry, css::uno::UNO_QUERY); if(!xConfRegistry_simple.is()) throw css::uno::RuntimeException("javavm.cxx: couldn't get ConfigurationRegistry", nullptr); - xConfRegistry_simple->open("org.openoffice.Inet", sal_True, sal_False); + xConfRegistry_simple->open("org.openoffice.Inet", true, false); css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey(); // if ooInetProxyType is not 0 then read the settings @@ -370,7 +370,7 @@ void getDefaultLocaleFromConfig( throw css::uno::RuntimeException( OUString("javavm.cxx: couldn't get ConfigurationRegistry"), nullptr); - xConfRegistry_simple->open("org.openoffice.Setup", sal_True, sal_False); + xConfRegistry_simple->open("org.openoffice.Setup", true, false); css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey(); // read locale @@ -405,7 +405,6 @@ void getDefaultLocaleFromConfig( } - void getJavaPropsFromSafetySettings( stoc_javavm::JVM * pjvm, const css::uno::Reference<css::lang::XMultiComponentFactory> & xSMgr, @@ -427,7 +426,7 @@ void getJavaPropsFromSafetySettings( xConfRegistry_simple->open( "org.openoffice.Office.Java", - sal_True, sal_False); + true, false); css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey(); @@ -467,7 +466,7 @@ void getJavaPropsFromSafetySettings( xConfRegistry_simple->close(); } -static void setTimeZone(stoc_javavm::JVM * pjvm) throw() { +void setTimeZone(stoc_javavm::JVM * pjvm) throw() { /* A Bug in the Java function ** struct Hjava_util_Properties * java_lang_System_initProperties( ** struct Hjava_lang_System *this, @@ -502,24 +501,14 @@ void initVMConfiguration( getINetPropsFromConfig(&jvm, xSMgr, xCtx); } catch(const css::uno::Exception & exception) { -#if OSL_DEBUG_LEVEL > 1 - OString message = OUStringToOString(exception.Message, RTL_TEXTENCODING_ASCII_US); - OSL_TRACE("javavm.cxx: can not get INetProps cause of >%s<", message.getStr()); -#else - (void) exception; // unused -#endif + SAL_INFO("stoc", "can not get INETProps because of >" << exception.Message << "<"); } try { getDefaultLocaleFromConfig(&jvm, xSMgr,xCtx); } catch(const css::uno::Exception & exception) { -#if OSL_DEBUG_LEVEL > 1 - OString message = OUStringToOString(exception.Message, RTL_TEXTENCODING_ASCII_US); - OSL_TRACE("javavm.cxx: can not get locale cause of >%s<", message.getStr()); -#else - (void) exception; // unused -#endif + SAL_INFO("stoc", "can not get locale because of >" << exception.Message << "<"); } try @@ -527,12 +516,7 @@ void initVMConfiguration( getJavaPropsFromSafetySettings(&jvm, xSMgr, xCtx); } catch(const css::uno::Exception & exception) { -#if OSL_DEBUG_LEVEL > 1 - OString message = OUStringToOString(exception.Message, RTL_TEXTENCODING_ASCII_US); - OSL_TRACE("javavm.cxx: couldn't get safety settings because of >%s<", message.getStr()); -#else - (void) exception; // unused -#endif + SAL_INFO("stoc", "couldn't get safety settings because of >" << exception.Message << "<"); } *pjvm= jvm; @@ -547,7 +531,7 @@ void initVMConfiguration( setTimeZone(pjvm); } -class DetachCurrentThread: private boost::noncopyable { +class DetachCurrentThread { public: explicit DetachCurrentThread(JavaVM * jvm): m_jvm(jvm) {} @@ -557,6 +541,9 @@ public: } } + DetachCurrentThread(const DetachCurrentThread&) = delete; + DetachCurrentThread& operator=(const DetachCurrentThread&) = delete; + private: JavaVM * m_jvm; }; @@ -659,23 +646,6 @@ JavaVirtualMachine::getSupportedServiceNames() return serviceGetSupportedServiceNames(); } -namespace { - -struct JavaInfoGuard: private boost::noncopyable { - JavaInfoGuard(): info(nullptr) {} - - ~JavaInfoGuard() { jfw_freeJavaInfo(info); } - - void clear() { - jfw_freeJavaInfo(info); - info = nullptr; - } - - JavaInfo * info; -}; - -} - css::uno::Any SAL_CALL JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) throw (css::uno::RuntimeException, std::exception) @@ -700,7 +670,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) if (aId != aProcessId) return css::uno::Any(); - JavaInfoGuard info; + jfw::JavaInfoGuard info; while (!m_xVirtualMachine.is()) // retry until successful { // This is the second attempt to create Java. m_bDontCreateJvm is @@ -818,14 +788,14 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //we search another one. As long as there is a javaldx, we should //never come into this situation. javaldx checks always if the JRE //still exist. - JavaInfo * pJavaInfo = nullptr; - if (JFW_E_NONE == jfw_getSelectedJRE(&pJavaInfo)) + jfw::JavaInfoGuard aJavaInfo; + if (JFW_E_NONE == jfw_getSelectedJRE(&aJavaInfo.info)) { - sal_Bool bExist = sal_False; - if (JFW_E_NONE == jfw_existJRE(pJavaInfo, &bExist)) + sal_Bool bExist = false; + if (JFW_E_NONE == jfw_existJRE(aJavaInfo.info, &bExist)) { if (!bExist - && ! (pJavaInfo->nRequirements & JFW_REQUIRE_NEEDRESTART)) + && ! (aJavaInfo.info->nRequirements & JFW_REQUIRE_NEEDRESTART)) { info.clear(); javaFrameworkError errFind = jfw_findAndSelectJRE( @@ -838,8 +808,6 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) } } - jfw_freeJavaInfo(pJavaInfo); - //Error: %PRODUCTNAME requires a Java //runtime environment (JRE) to perform this task. The selected JRE //is defective. Please select another version or install a new JRE @@ -948,7 +916,7 @@ sal_Bool SAL_CALL JavaVirtualMachine::isVMEnabled() // initVMConfiguration(&aJvm, m_xContext->getServiceManager(), m_xContext); // return aJvm.isEnabled(); //ToDo - sal_Bool bEnabled = sal_False; + sal_Bool bEnabled = false; if (jfw_getEnabled( & bEnabled) != JFW_E_NONE) throw css::uno::RuntimeException(); return bEnabled; @@ -1387,12 +1355,7 @@ void JavaVirtualMachine::registerConfigChangesListener() } }catch(const css::uno::Exception & e) { -#if OSL_DEBUG_LEVEL > 1 - OString message = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); - OSL_TRACE("javavm.cxx: could not set up listener for Configuration because of >%s<", message.getStr()); -#else - (void) e; // unused -#endif + SAL_INFO("stoc", "could not set up listener for Configuration because of >" << e.Message << "<"); } } diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx index 6437788eb113..2c1e0e90440e 100644 --- a/svtools/source/config/fontsubstconfig.cxx +++ b/svtools/source/config/fontsubstconfig.cxx @@ -122,15 +122,15 @@ void SvtFontSubstConfig::ImplCommit() { OUString sPrefix = sNode + "/_" + OUString::number(i) + "/"; - SubstitutionStruct& pSubst = pImpl->aSubstArr[i]; + SubstitutionStruct& rSubst = pImpl->aSubstArr[i]; pSetValues[nSetValue].Name = sPrefix; pSetValues[nSetValue].Name += sReplaceFont; - pSetValues[nSetValue++].Value <<= pSubst.sFont; + pSetValues[nSetValue++].Value <<= rSubst.sFont; pSetValues[nSetValue].Name = sPrefix; pSetValues[nSetValue].Name += sSubstituteFont; - pSetValues[nSetValue++].Value <<= pSubst.sReplaceBy; + pSetValues[nSetValue++].Value <<= rSubst.sReplaceBy; pSetValues[nSetValue].Name = sPrefix; pSetValues[nSetValue].Name += sAlways; - pSetValues[nSetValue++].Value.setValue(&pSubst.bReplaceAlways, rBoolType); + pSetValues[nSetValue++].Value.setValue(&rSubst.bReplaceAlways, rBoolType); pSetValues[nSetValue].Name = sPrefix; pSetValues[nSetValue].Name += sOnScreenOnly; - pSetValues[nSetValue++].Value.setValue(&pSubst.bReplaceOnScreenOnly, rBoolType); + pSetValues[nSetValue++].Value.setValue(&rSubst.bReplaceOnScreenOnly, rBoolType); } ReplaceSetProperties(sNode, aSetValues); } diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index f38852e6be16..59c2ac597160 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -58,7 +58,7 @@ #include <algorithm> #include <memory> #include <utility> - +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; using ::com::sun::star::uno::Reference; @@ -194,8 +194,6 @@ void AccessibleShape::Init() } - - void AccessibleShape::UpdateStates() { ::utl::AccessibleStateSetHelper* pStateSet = @@ -279,8 +277,6 @@ bool AccessibleShape::SetState (sal_Int16 aState) } - - bool AccessibleShape::ResetState (sal_Int16 aState) { bool bStateHasChanged = false; @@ -300,8 +296,6 @@ bool AccessibleShape::ResetState (sal_Int16 aState) } - - bool AccessibleShape::GetState (sal_Int16 aState) { if (aState == AccessibleStateType::FOCUSED && mpText != nullptr) @@ -357,8 +351,6 @@ sal_Int32 SAL_CALL } - - /** Forward the request to the shape. Return the requested shape or throw an exception for a wrong index. */ @@ -441,11 +433,11 @@ uno::Reference<XAccessibleStateSet> SAL_CALL css::uno::Reference<XAccessibleStateSet> rState = xTempAccContext->getAccessibleStateSet(); if( rState.is() ) { - css::uno::Sequence<short> pStates = rState->getStates(); - int count = pStates.getLength(); + css::uno::Sequence<short> aStates = rState->getStates(); + int count = aStates.getLength(); for( int iIndex = 0;iIndex < count;iIndex++ ) { - if( pStates[iIndex] == AccessibleStateType::EDITABLE ) + if( aStates[iIndex] == AccessibleStateType::EDITABLE ) { pStateSet->AddState (AccessibleStateType::EDITABLE); pStateSet->AddState (AccessibleStateType::RESIZABLE); @@ -484,11 +476,11 @@ uno::Reference<XAccessibleStateSet> SAL_CALL css::uno::Reference<XAccessibleStateSet> rState = xTempAccContext->getAccessibleStateSet(); if( rState.is() ) { - css::uno::Sequence<short> pStates = rState->getStates(); - int count = pStates.getLength(); + css::uno::Sequence<short> aStates = rState->getStates(); + int count = aStates.getLength(); for( int iIndex = 0;iIndex < count;iIndex++ ) { - if( pStates[iIndex] == AccessibleStateType::EDITABLE ) + if( aStates[iIndex] == AccessibleStateType::EDITABLE ) { pStateSet->AddState (AccessibleStateType::EDITABLE); pStateSet->AddState (AccessibleStateType::RESIZABLE); @@ -550,8 +542,6 @@ uno::Reference<XAccessible > SAL_CALL } - - awt::Rectangle SAL_CALL AccessibleShape::getBounds() throw (css::uno::RuntimeException, std::exception) { @@ -665,8 +655,6 @@ awt::Rectangle SAL_CALL AccessibleShape::getBounds() } - - awt::Point SAL_CALL AccessibleShape::getLocation() throw (css::uno::RuntimeException, std::exception) { @@ -676,8 +664,6 @@ awt::Point SAL_CALL AccessibleShape::getLocation() } - - awt::Point SAL_CALL AccessibleShape::getLocationOnScreen() throw (css::uno::RuntimeException, std::exception) { @@ -701,8 +687,6 @@ awt::Point SAL_CALL AccessibleShape::getLocationOnScreen() } - - awt::Size SAL_CALL AccessibleShape::getSize() throw (uno::RuntimeException, std::exception) { @@ -712,8 +696,6 @@ awt::Size SAL_CALL AccessibleShape::getSize() } - - sal_Int32 SAL_CALL AccessibleShape::getForeground() throw (css::uno::RuntimeException, std::exception) { @@ -738,8 +720,6 @@ sal_Int32 SAL_CALL AccessibleShape::getForeground() } - - sal_Int32 SAL_CALL AccessibleShape::getBackground() throw (css::uno::RuntimeException, std::exception) { @@ -797,8 +777,6 @@ void SAL_CALL AccessibleShape::addAccessibleEventListener ( } - - void SAL_CALL AccessibleShape::removeAccessibleEventListener ( const Reference<XAccessibleEventListener >& rxListener) throw (uno::RuntimeException, std::exception) @@ -830,8 +808,6 @@ css::uno::Any SAL_CALL } - - void SAL_CALL AccessibleShape::acquire() throw () @@ -840,8 +816,6 @@ void SAL_CALL } - - void SAL_CALL AccessibleShape::release() throw () @@ -875,27 +849,27 @@ throw ( IndexOutOfBoundsException, xText(xAcc, uno::UNO_QUERY); if( xText.is() ) { - if( xText->getSelectionStart() >= 0 ) return sal_True; + if( xText->getSelectionStart() >= 0 ) return true; } } else if( xContext->getAccessibleRole() == AccessibleRole::SHAPE ) { Reference< XAccessibleStateSet > pRState = xContext->getAccessibleStateSet(); if( !pRState.is() ) - return sal_False; + return false; - uno::Sequence<short> pStates = pRState->getStates(); - int nCount = pStates.getLength(); + uno::Sequence<short> aStates = pRState->getStates(); + int nCount = aStates.getLength(); for( int i = 0; i < nCount; i++ ) { - if(pStates[i] == AccessibleStateType::SELECTED) - return sal_True; + if(aStates[i] == AccessibleStateType::SELECTED) + return true; } - return sal_False; + return false; } } - return sal_False; + return false; } @@ -972,8 +946,6 @@ OUString SAL_CALL } - - uno::Sequence<OUString> SAL_CALL AccessibleShape::getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) @@ -1260,11 +1232,6 @@ OUString } - - - - - // protected void AccessibleShape::disposing() { @@ -1324,8 +1291,6 @@ sal_Int32 SAL_CALL } - - void AccessibleShape::UpdateNameAndDescription() { // Ignore missing title, name, or description. There are fallbacks for @@ -1488,10 +1453,9 @@ throw (uno::RuntimeException, std::exception) std::sort( vXShapes.begin(), vXShapes.end(), XShapePosCompareHelper() ); //get the index of the selected object in the group - std::vector< uno::Reference<drawing::XShape> >::iterator aIter; //we start counting position from 1 sal_Int32 nPos = 1; - for ( aIter = vXShapes.begin(); aIter != vXShapes.end(); ++aIter, nPos++ ) + for ( std::vector< uno::Reference<drawing::XShape> >::const_iterator aIter = vXShapes.begin(); aIter != vXShapes.end(); ++aIter, nPos++ ) { if ( (*aIter).get() == mxShape.get() ) { @@ -1583,7 +1547,7 @@ sal_Int32 SAL_CALL AccessibleShape::getIndexAtPoint( const css::awt::Point& ) th OUString SAL_CALL AccessibleShape::getSelectedText( ) throw (css::uno::RuntimeException, std::exception){return OUString();} sal_Int32 SAL_CALL AccessibleShape::getSelectionStart( ) throw (css::uno::RuntimeException, std::exception){return 0;} sal_Int32 SAL_CALL AccessibleShape::getSelectionEnd( ) throw (css::uno::RuntimeException, std::exception){return 0;} -sal_Bool SAL_CALL AccessibleShape::setSelection( sal_Int32, sal_Int32 ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception){return sal_True;} +sal_Bool SAL_CALL AccessibleShape::setSelection( sal_Int32, sal_Int32 ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception){return true;} OUString SAL_CALL AccessibleShape::getText( ) throw (css::uno::RuntimeException, std::exception){return OUString();} OUString SAL_CALL AccessibleShape::getTextRange( sal_Int32, sal_Int32 ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception){return OUString();} css::accessibility::TextSegment SAL_CALL AccessibleShape::getTextAtIndex( sal_Int32, sal_Int16 ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) @@ -1601,7 +1565,7 @@ css::accessibility::TextSegment SAL_CALL AccessibleShape::getTextBehindIndex( sa css::accessibility::TextSegment aResult; return aResult; } -sal_Bool SAL_CALL AccessibleShape::copyText( sal_Int32, sal_Int32 ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception){return sal_True;} +sal_Bool SAL_CALL AccessibleShape::copyText( sal_Int32, sal_Int32 ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception){return true;} } // end of namespace accessibility diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index d1b9a485f61a..f945a9933b17 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -123,7 +123,6 @@ void SvxRectCtl::Resize() } - void SvxRectCtl::Resize_Impl() { aSize = GetOutputSize(); @@ -367,7 +366,6 @@ void SvxRectCtl::KeyInput( const KeyEvent& rKeyEvt ) } - void SvxRectCtl::StateChanged( StateChangedType nType ) { if ( nType == StateChangedType::ControlForeground ) @@ -379,7 +377,6 @@ void SvxRectCtl::StateChanged( StateChangedType nType ) } - void SvxRectCtl::DataChanged( const DataChangedEvent& rDCEvt ) { if ( ( rDCEvt.GetType() == DataChangedEventType::SETTINGS ) && ( rDCEvt.GetFlags() & AllSettingsFlags::STYLE ) ) @@ -970,11 +967,11 @@ void SvxPixelCtl::KeyInput( const KeyEvent& rKEvt ) if( !bIsMod ) { - Point pRepaintPoint( aRectSize.Width() *( aFocusPosition.getX() - 1)/ nLines - 1, + Point aRepaintPoint( aRectSize.Width() *( aFocusPosition.getX() - 1)/ nLines - 1, aRectSize.Height() *( aFocusPosition.getY() - 1)/ nLines -1 ); - Size mRepaintSize( aRectSize.Width() *3/ nLines + 2,aRectSize.Height() *3/ nLines + 2); - Rectangle mRepaintRect( pRepaintPoint, mRepaintSize ); + Size aRepaintSize( aRectSize.Width() *3/ nLines + 2,aRectSize.Height() *3/ nLines + 2); + Rectangle aRepaintRect( aRepaintPoint, aRepaintSize ); bool bFocusPosChanged=false; switch(nCode) { @@ -982,7 +979,7 @@ void SvxPixelCtl::KeyInput( const KeyEvent& rKEvt ) if((aFocusPosition.getX() >= 1)) { aFocusPosition.setX( aFocusPosition.getX() - 1 ); - Invalidate(mRepaintRect); + Invalidate(aRepaintRect); bFocusPosChanged=true; } break; @@ -990,7 +987,7 @@ void SvxPixelCtl::KeyInput( const KeyEvent& rKEvt ) if( aFocusPosition.getX() < (nLines - 1) ) { aFocusPosition.setX( aFocusPosition.getX() + 1 ); - Invalidate(mRepaintRect); + Invalidate(aRepaintRect); bFocusPosChanged=true; } break; @@ -998,7 +995,7 @@ void SvxPixelCtl::KeyInput( const KeyEvent& rKEvt ) if((aFocusPosition.getY() >= 1)) { aFocusPosition.setY( aFocusPosition.getY() - 1 ); - Invalidate(mRepaintRect); + Invalidate(aRepaintRect); bFocusPosChanged=true; } break; @@ -1006,7 +1003,7 @@ void SvxPixelCtl::KeyInput( const KeyEvent& rKEvt ) if( aFocusPosition.getY() < ( nLines - 1 ) ) { aFocusPosition.setY( aFocusPosition.getY() + 1 ); - Invalidate(mRepaintRect); + Invalidate(aRepaintRect); bFocusPosChanged=true; } break; @@ -1763,7 +1760,6 @@ void LineEndLB::Modify( const XLineEndEntry& rEntry, sal_Int32 nPos, const Bitma } - void SvxPreviewBase::InitSettings(bool bForeground, bool bBackground) { const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); @@ -1988,7 +1984,6 @@ void SvxXLinePreview::dispose() } - void SvxXLinePreview::SetSymbol(Graphic* p,const Size& s) { mpGraphic = p; @@ -1996,7 +1991,6 @@ void SvxXLinePreview::SetSymbol(Graphic* p,const Size& s) } - void SvxXLinePreview::ResizeSymbol(const Size& s) { if ( s != maSymbolSize ) @@ -2007,7 +2001,6 @@ void SvxXLinePreview::ResizeSymbol(const Size& s) } - void SvxXLinePreview::SetLineAttributes(const SfxItemSet& rItemSet) { // Set ItemSet at objects @@ -2023,7 +2016,6 @@ void SvxXLinePreview::SetLineAttributes(const SfxItemSet& rItemSet) } - void SvxXLinePreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) { LocalPrePaint(rRenderContext); diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index a81c3690dda6..752b40da87c8 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -652,11 +652,11 @@ SaveDialog::SaveDialog(vcl::Window* pParent, RecoveryCore* pCore) // fill listbox with current open documents m_pFileListLB->Clear(); - TURLList& pURLs = m_pCore->getURLListAccess(); + TURLList& rURLs = m_pCore->getURLListAccess(); TURLList::const_iterator pIt; - for ( pIt = pURLs.begin(); - pIt != pURLs.end() ; + for ( pIt = rURLs.begin(); + pIt != rURLs.end() ; ++pIt ) { const TURLInfo& rInfo = *pIt; @@ -902,10 +902,10 @@ RecoveryDialog::RecoveryDialog(vcl::Window* pParent, RecoveryCore* pCore) m_pCancelBtn->SetClickHdl( LINK( this, RecoveryDialog, CancelButtonHdl ) ); // fill list box first time - TURLList& pURLList = m_pCore->getURLListAccess(); + TURLList& rURLList = m_pCore->getURLListAccess(); TURLList::const_iterator pIt; - for ( pIt = pURLList.begin(); - pIt != pURLList.end() ; + for ( pIt = rURLList.begin(); + pIt != rURLList.end() ; ++pIt ) { const TURLInfo& rInfo = *pIt; @@ -1279,10 +1279,10 @@ void BrokenRecoveryDialog::dispose() void BrokenRecoveryDialog::impl_refresh() { m_bExecutionNeeded = false; - TURLList& pURLList = m_pCore->getURLListAccess(); + TURLList& rURLList = m_pCore->getURLListAccess(); TURLList::const_iterator pIt; - for ( pIt = pURLList.begin(); - pIt != pURLList.end() ; + for ( pIt = rURLList.begin(); + pIt != rURLList.end() ; ++pIt ) { const TURLInfo& rInfo = *pIt; diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index e1a97b380d6f..1757e6779e3e 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -1033,24 +1033,24 @@ void AreaPropertyPanelBase::Update() { const OUString aString(mpFillGradientItem->GetName()); mpLbFillAttr->SelectEntry(aString); - const XGradient pGradient = mpFillGradientItem->GetGradientValue(); - mpLbFillGradFrom->SelectEntry(pGradient.GetStartColor()); + const XGradient aGradient = mpFillGradientItem->GetGradientValue(); + mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor()); if(mpLbFillGradFrom->GetSelectEntryCount() == 0) { - mpLbFillGradFrom->InsertEntry(pGradient.GetStartColor(), OUString()); - mpLbFillGradFrom->SelectEntry(pGradient.GetStartColor()); + mpLbFillGradFrom->InsertEntry(aGradient.GetStartColor(), OUString()); + mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor()); } - mpLbFillGradTo->SelectEntry(pGradient.GetEndColor()); + mpLbFillGradTo->SelectEntry(aGradient.GetEndColor()); if(mpLbFillGradTo->GetSelectEntryCount() == 0) { - mpLbFillGradTo->InsertEntry(pGradient.GetEndColor(), OUString()); - mpLbFillGradTo->SelectEntry(pGradient.GetEndColor()); + mpLbFillGradTo->InsertEntry(aGradient.GetEndColor(), OUString()); + mpLbFillGradTo->SelectEntry(aGradient.GetEndColor()); } - mpGradientStyle->SelectEntryPos(sal::static_int_cast< sal_Int32 >( pGradient.GetGradientStyle() )); + mpGradientStyle->SelectEntryPos(sal::static_int_cast< sal_Int32 >( aGradient.GetGradientStyle() )); if(mpGradientStyle->GetSelectEntryPos() == GradientStyle_RADIAL) mpMTRAngle->Disable(); else - mpMTRAngle->SetValue( pGradient.GetAngle() /10 ); + mpMTRAngle->SetValue( aGradient.GetAngle() /10 ); } else { diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx index 74b4fa85b1d6..5b972a8f2c3a 100644 --- a/svx/source/table/accessiblecell.cxx +++ b/svx/source/table/accessiblecell.cxx @@ -241,11 +241,11 @@ Reference<XAccessibleStateSet> SAL_CALL AccessibleCell::getAccessibleStateSet() css::uno::Reference<XAccessibleStateSet> rState = xTempAccContext->getAccessibleStateSet(); if( rState.is() ) { - css::uno::Sequence<short> pStates = rState->getStates(); - int count = pStates.getLength(); + css::uno::Sequence<short> aStates = rState->getStates(); + int count = aStates.getLength(); for( int iIndex = 0;iIndex < count;iIndex++ ) { - if( pStates[iIndex] == AccessibleStateType::EDITABLE ) + if( aStates[iIndex] == AccessibleStateType::EDITABLE ) { pStateSet->AddState (AccessibleStateType::EDITABLE); pStateSet->AddState (AccessibleStateType::RESIZABLE); diff --git a/svx/source/table/tablerow.cxx b/svx/source/table/tablerow.cxx index 37212b72e797..608f66934f5d 100644 --- a/svx/source/table/tablerow.cxx +++ b/svx/source/table/tablerow.cxx @@ -157,7 +157,7 @@ void TableRow::removeColumns( sal_Int32 nIndex, sal_Int32 nCount ) } } -TableModelRef const & TableRow::getModel() const +const TableModelRef& TableRow::getModel() const { return mxTableModel; } diff --git a/svx/source/table/tablerow.hxx b/svx/source/table/tablerow.hxx index 5fdd94064cb0..88498f2e50f4 100644 --- a/svx/source/table/tablerow.hxx +++ b/svx/source/table/tablerow.hxx @@ -49,7 +49,7 @@ public: void insertColumns( sal_Int32 nIndex, sal_Int32 nCount, CellVector::iterator* pIter = nullptr ); void removeColumns( sal_Int32 nIndex, sal_Int32 nCount ); /// Reference to the table model containing this row. - TableModelRef const & getModel() const; + const TableModelRef& getModel() const; // XCellRange virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index e850661720fb..6333bb8c34cd 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -373,7 +373,7 @@ void SvxStyleBox_Impl::ReleaseFocus() IMPL_LINK_TYPED( SvxStyleBox_Impl, MenuSelectHdl, Menu*, pMenu, bool) { - OUString sEntry = OUString( GetSelectEntry() ); + OUString sEntry = GetSelectEntry(); ReleaseFocus(); // It must be after getting entry pos! Sequence< PropertyValue > aArgs( 2 ); aArgs[0].Name = "Param"; @@ -840,7 +840,7 @@ IMPL_LINK_TYPED(SvxStyleBox_Impl, CalcOptimalExtraUserWidth, VclWindowEvent&, ev // return is always the Font-Color // when both light or dark, change the Contrast // in other case do not change the origin color -// when the color is R=G=B=128 the DecreaseContast make 128 the need a exception +// when the color is R=G=B=128 the DecreaseContrast make 128 the need a exception Color SvxStyleBox_Impl::TestColorsVisible(const Color &FontCol, const Color &BackCol) { const sal_uInt8 ChgVal = 60; // increase/decrease the Contrast @@ -860,7 +860,6 @@ Color SvxStyleBox_Impl::TestColorsVisible(const Color &FontCol, const Color &Bac } - static bool lcl_GetDocFontList( const FontList** ppFontList, SvxFontNameBox_Impl* pBox ) { bool bChanged = false; @@ -2026,7 +2025,7 @@ struct SvxStyleToolBoxControl::Impl Reference<container::XNameAccess> xParaStyles; xStylesSupplier->getStyleFamilies()->getByName("ParagraphStyles") >>= xParaStyles; - static const sal_Char* aWriterStyles[] = + static const std::vector<OUString> aWriterStyles = { "Text body", "Quotations", @@ -2036,12 +2035,12 @@ struct SvxStyleToolBoxControl::Impl "Heading 2", "Heading 3" }; - for( sal_uInt32 nStyle = 0; nStyle < sizeof( aWriterStyles ) / sizeof( sal_Char*); ++nStyle ) + for( const OUString& aStyle: aWriterStyles ) { try { Reference< beans::XPropertySet > xStyle; - xParaStyles->getByName( OUString::createFromAscii( aWriterStyles[nStyle] )) >>= xStyle; + xParaStyles->getByName( aStyle ) >>= xStyle; OUString sName; xStyle->getPropertyValue("DisplayName") >>= sName; if( !sName.isEmpty() ) @@ -2065,7 +2064,7 @@ struct SvxStyleToolBoxControl::Impl }; Reference<container::XNameAccess> xCellStyles; xStylesSupplier->getStyleFamilies()->getByName("CellStyles") >>= xCellStyles; - for( sal_uInt32 nStyle = 0; nStyle < sizeof( aCalcStyles ) / sizeof( sal_Char*); ++nStyle ) + for( sal_uInt32 nStyle = 0; nStyle < SAL_N_ELEMENTS(aCalcStyles); ++nStyle ) { try { diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 58cd9b4c7bd5..9c70a6556b21 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -282,10 +282,10 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() mpOStm->Seek( 0 ); sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW; - sal_uInt16 pDeterminedFormat = GRFILTER_FORMAT_DONTKNOW; - GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, "", *mpOStm ,nFormat,&pDeterminedFormat ); + sal_uInt16 nDeterminedFormat = GRFILTER_FORMAT_DONTKNOW; + GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, "", *mpOStm ,nFormat,&nDeterminedFormat ); - if (pDeterminedFormat == GRFILTER_FORMAT_DONTKNOW) + if (nDeterminedFormat == GRFILTER_FORMAT_DONTKNOW) { //Read the first two byte to check whether it is a gzipped stream, is so it may be in wmz or emz format //unzip them and try again @@ -326,7 +326,7 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() if (nStreamLen_) { pDest->Seek(0L); - GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, "", *pDest ,nFormat,&pDeterminedFormat ); + GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, "", *pDest ,nFormat,&nDeterminedFormat ); } } } diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx index dcd7e577e0e6..937feab1d791 100644 --- a/sw/source/core/access/accframebase.cxx +++ b/sw/source/core/access/accframebase.cxx @@ -307,11 +307,11 @@ bool SwAccessibleFrameBase::GetSelectedState( ) // SELETED. SwFlyFrame* pFlyFrame = getFlyFrame(); const SwFrameFormat *pFrameFormat = pFlyFrame->GetFormat(); - const SwFormatAnchor& pAnchor = pFrameFormat->GetAnchor(); - const SwPosition *pPos = pAnchor.GetContentAnchor(); + const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); + const SwPosition *pPos = rAnchor.GetContentAnchor(); if( !pPos ) return false; - int pIndex = pPos->nContent.GetIndex(); + int nIndex = pPos->nContent.GetIndex(); if( pPos->nNode.GetNode().GetTextNode() ) { SwPaM* pCursor = GetCursor(); @@ -334,13 +334,13 @@ bool SwAccessibleFrameBase::GetSelectedState( ) sal_uLong nEndIndex = pEnd->nNode.GetIndex(); if( ( nHere >= nStartIndex ) && (nHere <= nEndIndex) ) { - if( pAnchor.GetAnchorId() == FLY_AS_CHAR ) + if( rAnchor.GetAnchorId() == FLY_AS_CHAR ) { - if( ((nHere == nStartIndex) && (pIndex >= pStart->nContent.GetIndex())) || (nHere > nStartIndex) ) - if( ((nHere == nEndIndex) && (pIndex < pEnd->nContent.GetIndex())) || (nHere < nEndIndex) ) + if( ((nHere == nStartIndex) && (nIndex >= pStart->nContent.GetIndex())) || (nHere > nStartIndex) ) + if( ((nHere == nEndIndex) && (nIndex < pEnd->nContent.GetIndex())) || (nHere < nEndIndex) ) return true; } - else if( pAnchor.GetAnchorId() == FLY_AT_PARA ) + else if( rAnchor.GetAnchorId() == FLY_AT_PARA ) { if( ((nHere > nStartIndex) || pStart->nContent.GetIndex() ==0 ) && (nHere < nEndIndex ) ) diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index ed9ec9db9b29..1e1532ae1b38 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1150,7 +1150,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() { while( aIter != aEndIter ) { - SwAccessibleChild pFrame( (*aIter).first ); + SwAccessibleChild aFrame( (*aIter).first ); const SwFrameFormat *pFrameFormat = (*aIter).first ? ::FindFrameFormat( (*aIter).first ) : nullptr; if( !pFrameFormat ) @@ -1158,10 +1158,10 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() ++aIter; continue; } - const SwFormatAnchor& pAnchor = pFrameFormat->GetAnchor(); - const SwPosition *pPos = pAnchor.GetContentAnchor(); + const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); + const SwPosition *pPos = rAnchor.GetContentAnchor(); - if(pAnchor.GetAnchorId() == FLY_AT_PAGE) + if(rAnchor.GetAnchorId() == FLY_AT_PAGE) { uno::Reference < XAccessible > xAcc( (*aIter).second ); if(xAcc.is()) @@ -1178,7 +1178,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() } if( pPos->nNode.GetNode().GetTextNode() ) { - int pIndex = pPos->nContent.GetIndex(); + int nIndex = pPos->nContent.GetIndex(); bool bMarked = false; if( pCursor != nullptr ) { @@ -1198,10 +1198,10 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() sal_uLong nEndIndex = pEnd->nNode.GetIndex(); if( ( nHere >= nStartIndex ) && (nHere <= nEndIndex) ) { - if( pAnchor.GetAnchorId() == FLY_AS_CHAR ) + if( rAnchor.GetAnchorId() == FLY_AS_CHAR ) { - if( ( ((nHere == nStartIndex) && (pIndex >= pStart->nContent.GetIndex())) || (nHere > nStartIndex) ) - &&( ((nHere == nEndIndex) && (pIndex < pEnd->nContent.GetIndex())) || (nHere < nEndIndex) ) ) + if( ( ((nHere == nStartIndex) && (nIndex >= pStart->nContent.GetIndex())) || (nHere > nStartIndex) ) + &&( ((nHere == nEndIndex) && (nIndex < pEnd->nContent.GetIndex())) || (nHere < nEndIndex) ) ) { uno::Reference < XAccessible > xAcc( (*aIter).second ); if( xAcc.is() ) @@ -1214,7 +1214,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() static_cast < ::accessibility::AccessibleShape* >(xAcc.get())->ResetState( AccessibleStateType::SELECTED ); } } - else if( pAnchor.GetAnchorId() == FLY_AT_PARA ) + else if( rAnchor.GetAnchorId() == FLY_AT_PARA ) { if( ((nHere > nStartIndex) || pStart->nContent.GetIndex() ==0 ) && (nHere < nEndIndex ) ) @@ -1280,8 +1280,8 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() const SwFrameFormat *pFrameFormat = pFlyFrame->GetFormat(); if (pFrameFormat) { - const SwFormatAnchor& pAnchor = pFrameFormat->GetAnchor(); - if( pAnchor.GetAnchorId() == FLY_AS_CHAR ) + const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); + if( rAnchor.GetAnchorId() == FLY_AS_CHAR ) { uno::Reference< XAccessible > xAccParent = pAccFrame->getAccessibleParent(); if (xAccParent.is()) @@ -1551,8 +1551,8 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool bInvalidateFocusMode /*=fa SwFrameFormat *pFrameFormat = pObj ? FindFrameFormat( pObj ) : nullptr; if (pFrameFormat) { - const SwFormatAnchor& pAnchor = pFrameFormat->GetAnchor(); - if( pAnchor.GetAnchorId() == FLY_AS_CHAR ) + const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); + if( rAnchor.GetAnchorId() == FLY_AS_CHAR ) { uno::Reference< XAccessible > xPara = pAccShape->getAccessibleParent(); if (xPara.is()) diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 7fdd058a9d63..ea545e1637f8 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -3808,8 +3808,7 @@ sal_Int16 SAL_CALL SwAccessibleParagraph::getAccessibleRole() throw (css::uno::R sal_Int32 SwAccessibleParagraph::GetRealHeadingLevel() { uno::Reference< css::beans::XPropertySet > xPortion = CreateUnoPortion( 0, 0 ); - OUString pString = "ParaStyleName"; - uno::Any styleAny = xPortion->getPropertyValue( pString ); + uno::Any styleAny = xPortion->getPropertyValue( "ParaStyleName" ); OUString sValue; if (styleAny >>= sValue) { diff --git a/sw/source/core/access/accselectionhelper.cxx b/sw/source/core/access/accselectionhelper.cxx index dd674de28d30..8827404d44a5 100644 --- a/sw/source/core/access/accselectionhelper.cxx +++ b/sw/source/core/access/accselectionhelper.cxx @@ -125,11 +125,11 @@ static bool lcl_getSelectedState(const SwAccessibleChild& aChild, Reference<XAccessibleStateSet> pRStateSet = pRContext->getAccessibleStateSet(); if( pRStateSet.is() ) { - Sequence<short> pStates = pRStateSet->getStates(); - sal_Int32 count = pStates.getLength(); + Sequence<short> aStates = pRStateSet->getStates(); + sal_Int32 count = aStates.getLength(); for( sal_Int32 i = 0; i < count; i++ ) { - if( pStates[i] == AccessibleStateType::SELECTED) + if( aStates[i] == AccessibleStateType::SELECTED) return true; } } @@ -300,11 +300,11 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild( const SwFrameFormat *pFrameFormat = pFlyFrame->GetFormat(); if (pFrameFormat) { - const SwFormatAnchor& pAnchor = pFrameFormat->GetAnchor(); - if( pAnchor.GetAnchorId() == FLY_AS_CHAR ) + const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); + if( rAnchor.GetAnchorId() == FLY_AS_CHAR ) { - const SwFrame *pParaFrame = SwAccessibleFrame::GetParent( SwAccessibleChild(pFlyFrame), m_rContext.IsInPagePreview() ); - aChild = pParaFrame; + const SwFrame *pParaFrame = SwAccessibleFrame::GetParent( SwAccessibleChild(pFlyFrame), m_rContext.IsInPagePreview() ); + aChild = pParaFrame; } } } diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index e93a6c9d7014..bcdec685466b 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -95,8 +95,8 @@ static void lcl_notifyRow(const SwContentNode* pNode, SwCursorShell& rShell) { if (pContent->GetType() == FRM_TAB) { - SwFormatFrameSize pSize = pLine->GetFrameFormat()->GetFrameSize(); - pRow->ModifyNotification(nullptr, &pSize); + SwFormatFrameSize aSize = pLine->GetFrameFormat()->GetFrameSize(); + pRow->ModifyNotification(nullptr, &aSize); return; } } diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx index 9b0b2947c768..cad35f8ddb05 100644 --- a/sw/source/core/doc/CntntIdxStore.cxx +++ b/sw/source/core/doc/CntntIdxStore.cxx @@ -264,9 +264,9 @@ void ContentIdxStoreImpl::RestoreBkmks(SwDoc* pDoc, updater_t& rUpdater) void ContentIdxStoreImpl::SaveRedlines(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent) { - SwRedlineTable const & pRedlineTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable(); + SwRedlineTable const & rRedlineTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable(); long int nIdx = 0; - for (const SwRangeRedline* pRdl : pRedlineTable) + for (const SwRangeRedline* pRdl : rRedlineTable) { int nPointPos = lcl_RelativePosition( *pRdl->GetPoint(), nNode, nContent ); int nMarkPos = pRdl->HasMark() ? lcl_RelativePosition( *pRdl->GetMark(), nNode, nContent ) : diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx index b46ae0c38793..2a02b440d4cf 100644 --- a/sw/source/core/doc/SwStyleNameMapper.cxx +++ b/sw/source/core/doc/SwStyleNameMapper.cxx @@ -18,7 +18,7 @@ */ #include <numeric> -#include <boost/tuple/tuple.hpp> +#include <tuple> #include <SwStyleNameMapper.hxx> #include <tools/resmgr.hxx> @@ -312,7 +312,7 @@ const struct SwTableEntry NumRuleProgNameTable [] = }; #undef ENTRY -static ::std::vector<OUString>* +::std::vector<OUString>* lcl_NewUINameArray(sal_uInt16 nStt, sal_uInt16 const nEnd) { ::std::vector<OUString> *const pNameArray = new ::std::vector<OUString>; @@ -326,7 +326,7 @@ lcl_NewUINameArray(sal_uInt16 nStt, sal_uInt16 const nEnd) return pNameArray; } -static ::std::vector<OUString>* +::std::vector<OUString>* lcl_NewProgNameArray(const SwTableEntry *pTable, sal_uInt8 const nCount) { ::std::vector<OUString> *const pProgNameArray = new ::std::vector<OUString>; @@ -340,7 +340,7 @@ lcl_NewProgNameArray(const SwTableEntry *pTable, sal_uInt8 const nCount) return pProgNameArray; } -static OUString +OUString lcl_GetSpecialExtraName(const OUString& rExtraName, const bool bIsUIName ) { const ::std::vector<OUString>& rExtraArr = bIsUIName @@ -367,7 +367,7 @@ lcl_GetSpecialExtraName(const OUString& rExtraName, const bool bIsUIName ) return rExtraName; } -static bool lcl_SuffixIsUser(const OUString & rString) +bool lcl_SuffixIsUser(const OUString & rString) { const sal_Unicode *pChar = rString.getStr(); sal_Int32 nLen = rString.getLength(); @@ -384,7 +384,7 @@ static bool lcl_SuffixIsUser(const OUString & rString) return bRet; } -static void lcl_CheckSuffixAndDelete(OUString & rString) +void lcl_CheckSuffixAndDelete(OUString & rString) { if (lcl_SuffixIsUser(rString)) { @@ -392,11 +392,11 @@ static void lcl_CheckSuffixAndDelete(OUString & rString) } } -typedef boost::tuple<sal_uInt16, sal_uInt16, const ::std::vector<OUString>& (*)() > NameArrayIndexTuple_t; +typedef std::tuple<sal_uInt16, sal_uInt16, const std::vector<OUString>& (*)() > NameArrayIndexTuple_t; -static sal_uInt16 lcl_AccumulateIndexCount( sal_uInt16 nSum, const NameArrayIndexTuple_t& tuple ){ +sal_uInt16 lcl_AccumulateIndexCount( sal_uInt16 nSum, const NameArrayIndexTuple_t& tuple ){ // Return running sum + (index end) - (index start) - return nSum + boost::get<1>( tuple ) - boost::get<0>( tuple ); + return nSum + std::get<1>( tuple ) - std::get<0>( tuple ); } } @@ -436,37 +436,37 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag case nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL: { pHashPointer = bProgName ? &m_pParaProgMap : &m_pParaUIMap; - vIndexes.push_back( boost::make_tuple(RES_POOLCOLL_TEXT_BEGIN, RES_POOLCOLL_TEXT_END, bProgName ? &GetTextProgNameArray : &GetTextUINameArray) ); - vIndexes.push_back( boost::make_tuple(RES_POOLCOLL_LISTS_BEGIN, RES_POOLCOLL_LISTS_END, bProgName ? &GetListsProgNameArray : &GetListsUINameArray) ); - vIndexes.push_back( boost::make_tuple(RES_POOLCOLL_EXTRA_BEGIN, RES_POOLCOLL_EXTRA_END, bProgName ? &GetExtraProgNameArray : &GetExtraUINameArray) ); - vIndexes.push_back( boost::make_tuple(RES_POOLCOLL_REGISTER_BEGIN, RES_POOLCOLL_REGISTER_END, bProgName ? &GetRegisterProgNameArray : &GetRegisterUINameArray) ); - vIndexes.push_back( boost::make_tuple(RES_POOLCOLL_DOC_BEGIN, RES_POOLCOLL_DOC_END, bProgName ? &GetDocProgNameArray : &GetDocUINameArray) ); - vIndexes.push_back( boost::make_tuple(RES_POOLCOLL_HTML_BEGIN, RES_POOLCOLL_HTML_END, bProgName ? &GetHTMLProgNameArray : &GetHTMLUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLCOLL_TEXT_BEGIN, RES_POOLCOLL_TEXT_END, bProgName ? &GetTextProgNameArray : &GetTextUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLCOLL_LISTS_BEGIN, RES_POOLCOLL_LISTS_END, bProgName ? &GetListsProgNameArray : &GetListsUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLCOLL_EXTRA_BEGIN, RES_POOLCOLL_EXTRA_END, bProgName ? &GetExtraProgNameArray : &GetExtraUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLCOLL_REGISTER_BEGIN, RES_POOLCOLL_REGISTER_END, bProgName ? &GetRegisterProgNameArray : &GetRegisterUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLCOLL_DOC_BEGIN, RES_POOLCOLL_DOC_END, bProgName ? &GetDocProgNameArray : &GetDocUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLCOLL_HTML_BEGIN, RES_POOLCOLL_HTML_END, bProgName ? &GetHTMLProgNameArray : &GetHTMLUINameArray) ); } break; case nsSwGetPoolIdFromName::GET_POOLID_CHRFMT: { pHashPointer = bProgName ? &m_pCharProgMap : &m_pCharUIMap; - vIndexes.push_back( boost::make_tuple(RES_POOLCHR_NORMAL_BEGIN, RES_POOLCHR_NORMAL_END, bProgName ? &GetChrFormatProgNameArray : &GetChrFormatUINameArray) ); - vIndexes.push_back( boost::make_tuple(RES_POOLCHR_HTML_BEGIN, RES_POOLCHR_HTML_END, bProgName ? &GetHTMLChrFormatProgNameArray : &GetHTMLChrFormatUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLCHR_NORMAL_BEGIN, RES_POOLCHR_NORMAL_END, bProgName ? &GetChrFormatProgNameArray : &GetChrFormatUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLCHR_HTML_BEGIN, RES_POOLCHR_HTML_END, bProgName ? &GetHTMLChrFormatProgNameArray : &GetHTMLChrFormatUINameArray) ); } break; case nsSwGetPoolIdFromName::GET_POOLID_FRMFMT: { pHashPointer = bProgName ? &m_pFrameProgMap : &m_pFrameUIMap; - vIndexes.push_back( boost::make_tuple(RES_POOLFRM_BEGIN, RES_POOLFRM_END, bProgName ? &GetFrameFormatProgNameArray : &GetFrameFormatUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLFRM_BEGIN, RES_POOLFRM_END, bProgName ? &GetFrameFormatProgNameArray : &GetFrameFormatUINameArray) ); } break; case nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC: { pHashPointer = bProgName ? &m_pPageProgMap : &m_pPageUIMap; - vIndexes.push_back( boost::make_tuple(RES_POOLPAGE_BEGIN, RES_POOLPAGE_END, bProgName ? &GetPageDescProgNameArray : &GetPageDescUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLPAGE_BEGIN, RES_POOLPAGE_END, bProgName ? &GetPageDescProgNameArray : &GetPageDescUINameArray) ); } break; case nsSwGetPoolIdFromName::GET_POOLID_NUMRULE: { pHashPointer = bProgName ? &m_pNumRuleProgMap : &m_pNumRuleUIMap; - vIndexes.push_back( boost::make_tuple(RES_POOLNUMRULE_BEGIN, RES_POOLNUMRULE_END, bProgName ? &GetNumRuleProgNameArray : &GetNumRuleUINameArray) ); + vIndexes.push_back( std::make_tuple(RES_POOLNUMRULE_BEGIN, RES_POOLNUMRULE_END, bProgName ? &GetNumRuleProgNameArray : &GetNumRuleUINameArray) ); } break; } @@ -482,13 +482,13 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag for ( ::std::vector<NameArrayIndexTuple_t>::iterator entry = vIndexes.begin(); entry != vIndexes.end(); ++entry ) { // Get a pointer to the function which will populate pStrings - const ::std::vector<OUString>& (*pStringsFetchFunc)() = boost::get<2>( *entry ); + const ::std::vector<OUString>& (*pStringsFetchFunc)() = std::get<2>( *entry ); if ( pStringsFetchFunc ) { - const ::std::vector<OUString>& pStrings = pStringsFetchFunc(); + const ::std::vector<OUString>& rStrings = pStringsFetchFunc(); sal_uInt16 nIndex, nId; - for ( nIndex = 0, nId = boost::get<0>( *entry ) ; nId < boost::get<1>( *entry ) ; nId++, nIndex++ ) - (*pHash)[pStrings[nIndex]] = nId; + for ( nIndex = 0, nId = std::get<0>( *entry ) ; nId < std::get<1>( *entry ) ; nId++, nIndex++ ) + (*pHash)[rStrings[nIndex]] = nId; } } diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 644588e39f30..deeda828c619 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1077,8 +1077,8 @@ sal_uInt16 SwDoc::GetRefMarks( std::vector<OUString>* pNames ) const { if( pNames ) { - OUString pTmp(static_cast<const SwFormatRefMark*>(pItem)->GetRefName()); - pNames->insert(pNames->begin() + nCount, pTmp); + OUString aTmp(static_cast<const SwFormatRefMark*>(pItem)->GetRefName()); + pNames->insert(pNames->begin() + nCount, aTmp); } ++nCount; } diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 936245a4550f..4c2a77325b9b 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -146,8 +146,8 @@ bool SwExtraRedlineTable::DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rT if (pTableCellRedline) { const SwTableBox *pRedTabBox = &pTableCellRedline->GetTableBox(); - const SwTable& pRedTable = pRedTabBox->GetSttNd()->FindTableNode()->GetTable(); - if ( &pRedTable == &rTable ) + const SwTable& rRedTable = pRedTabBox->GetSttNd()->FindTableNode()->GetTable(); + if ( &rRedTable == &rTable ) { // Redline for this table const SwRedlineData& aRedlineData = pTableCellRedline->GetRedlineData(); @@ -169,9 +169,9 @@ bool SwExtraRedlineTable::DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rT if (pTableRowRedline) { const SwTableLine *pRedTabLine = &pTableRowRedline->GetTableLine(); - const SwTableBoxes &pRedTabBoxes = pRedTabLine->GetTabBoxes(); - const SwTable& pRedTable = pRedTabBoxes[0]->GetSttNd()->FindTableNode()->GetTable(); - if ( &pRedTable == &rTable ) + const SwTableBoxes &rRedTabBoxes = pRedTabLine->GetTabBoxes(); + const SwTable& rRedTable = rRedTabBoxes[0]->GetSttNd()->FindTableNode()->GetTable(); + if ( &rRedTable == &rTable ) { // Redline for this table const SwRedlineData& aRedlineData = pTableRowRedline->GetRedlineData(); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 683202a63037..675ef48be460 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2165,13 +2165,13 @@ void DrawGraphic( GraphicObject *pGrf = const_cast<GraphicObject*>(pBrush->GetGraphicObject()); if ( bConsiderBackgroundTransparency ) { - GraphicAttr pGrfAttr = pGrf->GetAttr(); - if ( (pGrfAttr.GetTransparency() != 0) && + GraphicAttr aGrfAttr = pGrf->GetAttr(); + if ( (aGrfAttr.GetTransparency() != 0) && (pBrush->GetColor() == COL_TRANSPARENT) ) { bTransparentGrfWithNoFillBackgrd = true; - nGrfTransparency = pGrfAttr.GetTransparency(); + nGrfTransparency = aGrfAttr.GetTransparency(); } } if ( pGrf->IsTransparent() ) diff --git a/sw/source/core/swg/SwXMLBlockExport.cxx b/sw/source/core/swg/SwXMLBlockExport.cxx index b2ee9e05b788..299bae7cb846 100644 --- a/sw/source/core/swg/SwXMLBlockExport.cxx +++ b/sw/source/core/swg/SwXMLBlockExport.cxx @@ -52,7 +52,7 @@ sal_uInt32 SwXMLBlockListExport::exportDoc(enum XMLTokenEnum ) XML_LIST_NAME, OUString (rBlockList.GetName())); { - SvXMLElementExport pRoot (*this, XML_NAMESPACE_BLOCKLIST, XML_BLOCK_LIST, true, true); + SvXMLElementExport aRoot (*this, XML_NAMESPACE_BLOCKLIST, XML_BLOCK_LIST, true, true); sal_uInt16 nBlocks= rBlockList.GetCount(); for ( sal_uInt16 i = 0; i < nBlocks; i++) { diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 2145dcb37012..ca19a59804cf 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -4232,9 +4232,9 @@ namespace { { mrTextNode.RemoveFromList(); - const SwNumRuleItem& pNumRuleItem = + const SwNumRuleItem& rNumRuleItem = dynamic_cast<const SwNumRuleItem&>(pItem); - if ( !pNumRuleItem.GetValue().isEmpty() ) + if ( !rNumRuleItem.GetValue().isEmpty() ) { mbAddTextNodeToList = true; // #i105562# @@ -4247,12 +4247,12 @@ namespace { // handle RES_PARATR_LIST_ID case RES_PARATR_LIST_ID: { - const SfxStringItem& pListIdItem = + const SfxStringItem& rListIdItem = dynamic_cast<const SfxStringItem&>(pItem); - OSL_ENSURE( pListIdItem.GetValue().getLength() > 0, + OSL_ENSURE( rListIdItem.GetValue().getLength() > 0, "<HandleSetAttrAtTextNode(..)> - empty list id attribute not excepted. Serious defect." ); const OUString sListIdOfTextNode = rTextNode.GetListId(); - if ( pListIdItem.GetValue() != sListIdOfTextNode ) + if ( rListIdItem.GetValue() != sListIdOfTextNode ) { mbAddTextNodeToList = true; if ( mrTextNode.IsInList() ) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 4caf0318315e..f18858886c49 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4736,9 +4736,8 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S { // get interoperability information about embedded objects uno::Reference< beans::XPropertySet > xPropSet( m_rExport.m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW ); - OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; uno::Sequence< beans::PropertyValue > aGrabBag, aObjectsInteropList,aObjectInteropAttributes; - xPropSet->getPropertyValue( pName ) >>= aGrabBag; + xPropSet->getPropertyValue( UNO_NAME_MISC_OBJ_INTEROPGRABBAG ) >>= aGrabBag; for( sal_Int32 i=0; i < aGrabBag.getLength(); ++i ) if ( aGrabBag[i].Name == "EmbeddedObjects" ) { @@ -5032,12 +5031,12 @@ bool DocxAttributeOutput::IsDiagram( const SdrObject* sdrObject ) // if the shape doesn't have the InteropGrabBag property, it's not a diagram uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; - if ( !xPropSetInfo->hasPropertyByName( pName ) ) + OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; + if ( !xPropSetInfo->hasPropertyByName( aName ) ) return false; uno::Sequence< beans::PropertyValue > propList; - xPropSet->getPropertyValue( pName ) >>= propList; + xPropSet->getPropertyValue( aName ) >>= propList; for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp ) { // if we find any of the diagram components, it's a diagram diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 1be1c997471b..0e501c0d21f4 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -894,11 +894,11 @@ void DocxExport::WriteSettings() uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; - if ( xPropSetInfo->hasPropertyByName( pName ) ) + OUString aGrabBagName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; + if ( xPropSetInfo->hasPropertyByName( aGrabBagName ) ) { uno::Sequence< beans::PropertyValue > propList; - xPropSet->getPropertyValue( pName ) >>= propList; + xPropSet->getPropertyValue( aGrabBagName ) >>= propList; for( sal_Int32 i=0; i < propList.getLength(); ++i ) { if ( propList[i].Name == "ThemeFontLangProps" ) @@ -973,13 +973,13 @@ void DocxExport::WriteTheme() uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; - if ( !xPropSetInfo->hasPropertyByName( pName ) ) + OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; + if ( !xPropSetInfo->hasPropertyByName( aName ) ) return; uno::Reference<xml::dom::XDocument> themeDom; uno::Sequence< beans::PropertyValue > propList; - xPropSet->getPropertyValue( pName ) >>= propList; + xPropSet->getPropertyValue( aName ) >>= propList; for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp ) { OUString propName = propList[nProp].Name; @@ -1011,14 +1011,14 @@ void DocxExport::WriteGlossary() uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; - if ( !xPropSetInfo->hasPropertyByName( pName ) ) + OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; + if ( !xPropSetInfo->hasPropertyByName( aName ) ) return; uno::Reference<xml::dom::XDocument> glossaryDocDom; uno::Sequence< uno::Sequence< uno::Any> > glossaryDomList; uno::Sequence< beans::PropertyValue > propList; - xPropSet->getPropertyValue( pName ) >>= propList; + xPropSet->getPropertyValue( aName ) >>= propList; sal_Int32 collectedProperties = 0; for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp ) { @@ -1082,14 +1082,14 @@ void DocxExport::WriteCustomXml() uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; - if ( !xPropSetInfo->hasPropertyByName( pName ) ) + OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; + if ( !xPropSetInfo->hasPropertyByName( aName ) ) return; uno::Sequence<uno::Reference<xml::dom::XDocument> > customXmlDomlist; uno::Sequence<uno::Reference<xml::dom::XDocument> > customXmlDomPropslist; uno::Sequence< beans::PropertyValue > propList; - xPropSet->getPropertyValue( pName ) >>= propList; + xPropSet->getPropertyValue( aName ) >>= propList; for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp ) { OUString propName = propList[nProp].Name; @@ -1153,14 +1153,14 @@ void DocxExport::WriteActiveX() uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; - if ( !xPropSetInfo->hasPropertyByName( pName ) ) + OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; + if ( !xPropSetInfo->hasPropertyByName( aName ) ) return; uno::Sequence<uno::Reference<xml::dom::XDocument> > activeXDomlist; uno::Sequence<uno::Reference<io::XInputStream> > activeXBinList; uno::Sequence< beans::PropertyValue > propList; - xPropSet->getPropertyValue( pName ) >>= propList; + xPropSet->getPropertyValue( aName ) >>= propList; for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp ) { OUString propName = propList[nProp].Name; @@ -1247,13 +1247,13 @@ void DocxExport::WriteEmbeddings() uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; - if ( !xPropSetInfo->hasPropertyByName( pName ) ) + OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; + if ( !xPropSetInfo->hasPropertyByName( aName ) ) return; uno::Sequence< beans::PropertyValue > embeddingsList; uno::Sequence< beans::PropertyValue > propList; - xPropSet->getPropertyValue( pName ) >>= propList; + xPropSet->getPropertyValue( aName ) >>= propList; for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp ) { OUString propName = propList[nProp].Name; diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 6518f4f126f2..191a9b9cff49 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -287,8 +287,8 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons m_pImpl->m_bParagraphHasDrawing = true; m_pImpl->m_pSerializer->startElementNS(XML_w, XML_drawing, FSEND); - const SvxLRSpaceItem pLRSpaceItem = pFrameFormat->GetLRSpace(false); - const SvxULSpaceItem pULSpaceItem = pFrameFormat->GetULSpace(false); + const SvxLRSpaceItem aLRSpaceItem = pFrameFormat->GetLRSpace(false); + const SvxULSpaceItem aULSpaceItem = pFrameFormat->GetULSpace(false); bool isAnchor; @@ -364,10 +364,10 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons lclMovePositionWithRotation(aPos, rSize, pObj->GetRotateAngle()); } attrList->add(XML_behindDoc, bOpaque ? "0" : "1"); - attrList->add(XML_distT, OString::number(TwipsToEMU(pULSpaceItem.GetUpper()) - nTopExt).getStr()); - attrList->add(XML_distB, OString::number(TwipsToEMU(pULSpaceItem.GetLower()) - nBottomExt).getStr()); - attrList->add(XML_distL, OString::number(TwipsToEMU(pLRSpaceItem.GetLeft()) - nLeftExt).getStr()); - attrList->add(XML_distR, OString::number(TwipsToEMU(pLRSpaceItem.GetRight()) - nRightExt).getStr()); + attrList->add(XML_distT, OString::number(TwipsToEMU(aULSpaceItem.GetUpper()) - nTopExt).getStr()); + attrList->add(XML_distB, OString::number(TwipsToEMU(aULSpaceItem.GetLower()) - nBottomExt).getStr()); + attrList->add(XML_distL, OString::number(TwipsToEMU(aLRSpaceItem.GetLeft()) - nLeftExt).getStr()); + attrList->add(XML_distR, OString::number(TwipsToEMU(aLRSpaceItem.GetRight()) - nRightExt).getStr()); attrList->add(XML_simplePos, "0"); attrList->add(XML_locked, "0"); attrList->add(XML_layoutInCell, "1"); @@ -556,10 +556,10 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons else { sax_fastparser::FastAttributeList* aAttrList = sax_fastparser::FastSerializerHelper::createAttrList(); - aAttrList->add(XML_distT, OString::number(TwipsToEMU(pULSpaceItem.GetUpper())).getStr()); - aAttrList->add(XML_distB, OString::number(TwipsToEMU(pULSpaceItem.GetLower())).getStr()); - aAttrList->add(XML_distL, OString::number(TwipsToEMU(pLRSpaceItem.GetLeft())).getStr()); - aAttrList->add(XML_distR, OString::number(TwipsToEMU(pLRSpaceItem.GetRight())).getStr()); + aAttrList->add(XML_distT, OString::number(TwipsToEMU(aULSpaceItem.GetUpper())).getStr()); + aAttrList->add(XML_distB, OString::number(TwipsToEMU(aULSpaceItem.GetLower())).getStr()); + aAttrList->add(XML_distL, OString::number(TwipsToEMU(aLRSpaceItem.GetLeft())).getStr()); + aAttrList->add(XML_distR, OString::number(TwipsToEMU(aLRSpaceItem.GetRight())).getStr()); const SdrObject* pObj = pFrameFormat->FindRealSdrObject(); if (pObj != nullptr) { @@ -1120,9 +1120,8 @@ void DocxSdrExport::writeDiagram(const SdrObject* sdrObject, const SwFrameFormat uno::Sequence< uno::Any > diagramDrawing; // retrieve the doms from the GrabBag - OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; uno::Sequence< beans::PropertyValue > propList; - xPropSet->getPropertyValue(pName) >>= propList; + xPropSet->getPropertyValue(UNO_NAME_MISC_OBJ_INTEROPGRABBAG) >>= propList; for (sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp) { OUString propName = propList[nProp].Name; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 4e088f1ed645..6e97113a543f 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3846,7 +3846,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat if (rGraphic.GetType()==GRAPHIC_NONE) return; - ConvertDataFormat pConvertDestinationFormat = ConvertDataFormat::WMF; + ConvertDataFormat aConvertDestinationFormat = ConvertDataFormat::WMF; const sal_Char* pConvertDestinationBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; GfxLink aGraphicLink; @@ -3883,7 +3883,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat break; case GFX_LINK_TYPE_NATIVE_GIF: // GIF is not supported by RTF, but we override default conversion to WMF, PNG seems fits better here. - pConvertDestinationFormat = ConvertDataFormat::PNG; + aConvertDestinationFormat = ConvertDataFormat::PNG; pConvertDestinationBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP; break; default: @@ -3994,7 +3994,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat else { aStream.Seek(0); - if (GraphicConverter::Export(aStream, rGraphic, pConvertDestinationFormat) != ERRCODE_NONE) + if (GraphicConverter::Export(aStream, rGraphic, aConvertDestinationFormat) != ERRCODE_NONE) SAL_WARN("sw.rtf", "failed to export the graphic"); pBLIPType = pConvertDestinationBLIPType; aStream.Seek(STREAM_SEEK_TO_END); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index ba0d4f03894a..1c5b24813d6f 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -1565,14 +1565,14 @@ SwNumRule* WW8ListManager::GetNumRuleForActivation(sal_uInt16 nLFOPosition, // #i25545# // #i100132# - a number format does not have to exist on given list level - SwNumFormat pFormat(rLFOInfo.pNumRule->Get(nLevel)); + SwNumFormat aFormat(rLFOInfo.pNumRule->Get(nLevel)); if (rReader.IsRightToLeft() && nLastLFOPosition != nLFOPosition) { - if ( pFormat.GetNumAdjust() == SVX_ADJUST_RIGHT) - pFormat.SetNumAdjust(SVX_ADJUST_LEFT); - else if ( pFormat.GetNumAdjust() == SVX_ADJUST_LEFT) - pFormat.SetNumAdjust(SVX_ADJUST_RIGHT); - rLFOInfo.pNumRule->Set(nLevel, pFormat); + if ( aFormat.GetNumAdjust() == SVX_ADJUST_RIGHT) + aFormat.SetNumAdjust(SVX_ADJUST_LEFT); + else if ( aFormat.GetNumAdjust() == SVX_ADJUST_LEFT) + aFormat.SetNumAdjust(SVX_ADJUST_RIGHT); + rLFOInfo.pNumRule->Set(nLevel, aFormat); } nLastLFOPosition = nLFOPosition; /* @@ -2318,11 +2318,11 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString, { case RES_CHRATR_COLOR: { - OUString pNm; - if (xPropSetInfo->hasPropertyByName(pNm = "TextColor")) + OUString aNm; + if (xPropSetInfo->hasPropertyByName(aNm = "TextColor")) { aTmp <<= (sal_Int32)static_cast<const SvxColorItem*>(pItem)->GetValue().GetColor(); - rPropSet->setPropertyValue(pNm, aTmp); + rPropSet->setPropertyValue(aNm, aTmp); } } aFont.SetColor(static_cast<const SvxColorItem*>(pItem)->GetValue()); @@ -2330,26 +2330,26 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString, case RES_CHRATR_FONT: { const SvxFontItem *pFontItem = static_cast<const SvxFontItem *>(pItem); - OUString pNm; - if (xPropSetInfo->hasPropertyByName(pNm = "FontStyleName")) + OUString aNm; + if (xPropSetInfo->hasPropertyByName(aNm = "FontStyleName")) { aTmp <<= OUString( pFontItem->GetStyleName()); - rPropSet->setPropertyValue( pNm, aTmp ); + rPropSet->setPropertyValue( aNm, aTmp ); } - if (xPropSetInfo->hasPropertyByName(pNm = "FontFamily")) + if (xPropSetInfo->hasPropertyByName(aNm = "FontFamily")) { aTmp <<= (sal_Int16)pFontItem->GetFamily(); - rPropSet->setPropertyValue( pNm, aTmp ); + rPropSet->setPropertyValue( aNm, aTmp ); } - if (xPropSetInfo->hasPropertyByName(pNm = "FontCharset")) + if (xPropSetInfo->hasPropertyByName(aNm = "FontCharset")) { aTmp <<= (sal_Int16)pFontItem->GetCharSet(); - rPropSet->setPropertyValue( pNm, aTmp ); + rPropSet->setPropertyValue( aNm, aTmp ); } - if (xPropSetInfo->hasPropertyByName(pNm = "FontPitch")) + if (xPropSetInfo->hasPropertyByName(aNm = "FontPitch")) { aTmp <<= (sal_Int16)pFontItem->GetPitch(); - rPropSet->setPropertyValue( pNm, aTmp ); + rPropSet->setPropertyValue( aNm, aTmp ); } aTmp <<= OUString( pFontItem->GetFamilyName()); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index afb28097453d..bdeb1946833d 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -531,8 +531,8 @@ sal_uInt16 SwWW8ImplReader::End_Field() aFieldPam, m_aFieldStack.back().GetBookmarkName(), ODF_FORMTEXT ) ); OSL_ENSURE(pFieldmark!=nullptr, "hmmm; why was the bookmark not created?"); if (pFieldmark!=nullptr) { - const IFieldmark::parameter_map_t& pParametersToAdd = m_aFieldStack.back().getParameters(); - pFieldmark->GetParameters()->insert(pParametersToAdd.begin(), pParametersToAdd.end()); + const IFieldmark::parameter_map_t& rParametersToAdd = m_aFieldStack.back().getParameters(); + pFieldmark->GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end()); } } break; @@ -604,8 +604,8 @@ sal_uInt16 SwWW8ImplReader::End_Field() ODF_UNHANDLED ); if ( pFieldmark ) { - const IFieldmark::parameter_map_t& pParametersToAdd = m_aFieldStack.back().getParameters(); - pFieldmark->GetParameters()->insert(pParametersToAdd.begin(), pParametersToAdd.end()); + const IFieldmark::parameter_map_t& rParametersToAdd = m_aFieldStack.back().getParameters(); + pFieldmark->GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end()); OUString sFieldId = OUString::number( m_aFieldStack.back().mnFieldId ); pFieldmark->GetParameters()->insert( std::pair< OUString, uno::Any > ( diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index 7d3bbb9b0dfd..cf4d0baa5642 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -370,10 +370,10 @@ SfxItemSet *SwEnvFormatPage::GetCollItemSet(SwTextFormatColl* pColl, bool bSende }; // BruteForce merge because MergeRange in SvTools is buggy: - std::vector<sal_uInt16> pVec = ::lcl_convertRangesToList(pRanges); + std::vector<sal_uInt16> aVec2 = ::lcl_convertRangesToList(pRanges); std::vector<sal_uInt16> aVec = ::lcl_convertRangesToList(aRanges); - pVec.insert(pVec.end(), aVec.begin(), aVec.end()); - std::unique_ptr<sal_uInt16[]> pNewRanges(::lcl_convertListToRanges(pVec)); + aVec2.insert(aVec2.end(), aVec.begin(), aVec.end()); + std::unique_ptr<sal_uInt16[]> pNewRanges(::lcl_convertListToRanges(aVec2)); pAddrSet = new SfxItemSet(GetParentSwEnvDlg()->pSh->GetView().GetCurShell()->GetPool(), pNewRanges.get()); diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index 285ca4a3d5cf..497e14c1361d 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -1163,7 +1163,7 @@ void SwSidebarWin::SetReadonly(bool bSet) void SwSidebarWin::SetLanguage(const SvxLanguageItem& rNewItem) { - Link<LinkParamNone*,void> pLink = Engine()->GetModifyHdl(); + Link<LinkParamNone*,void> aLink = Engine()->GetModifyHdl(); Engine()->SetModifyHdl( Link<LinkParamNone*,void>() ); ESelection aOld = GetOutlinerView()->GetSelection(); @@ -1174,7 +1174,7 @@ void SwSidebarWin::SetLanguage(const SvxLanguageItem& rNewItem) GetOutlinerView()->SetAttribs( aEditAttr ); GetOutlinerView()->SetSelection(aOld); - Engine()->SetModifyHdl( pLink ); + Engine()->SetModifyHdl( aLink ); const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions(); EEControlBits nCntrl = Engine()->GetControlWord(); diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index 3d004231fa01..27f3d6f9babc 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -635,15 +635,15 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) { std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> vFontHeight = rSh.GetItemWithPaM( RES_CHRATR_FONTSIZE ); - for ( std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM>>& pIt : vFontHeight ) + for ( const std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM>>& aIt : vFontHeight ) { - if (!pIt.first) + if (!aIt.first) { rSet.DisableItem(FN_GROW_FONT_SIZE); rSet.DisableItem(FN_SHRINK_FONT_SIZE); break; } - pSize = static_cast<const SvxFontHeightItem*>( pIt.first ); + pSize = static_cast<const SvxFontHeightItem*>( aIt.first ); sal_uInt32 nSize = pSize->GetHeight(); if( nSize == nFontMaxSz ) rSet.DisableItem( FN_GROW_FONT_SIZE ); diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index f8ff1a5370bf..f838c40f1e6b 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -418,7 +418,7 @@ public: } ~MailMergeExecuteFinalizer() { - osl::MutexGuard pMgrGuard( GetMailMergeMutex() ); + osl::MutexGuard aMgrGuard( GetMailMergeMutex() ); m_pMailMerge->m_pMgr = nullptr; } @@ -836,7 +836,7 @@ void SAL_CALL SwXMailMerge::cancel() throw (css::uno::RuntimeException, std::exc { // Cancel may be called from a second thread, so this protects from m_pMgr /// cleanup in the execute function. - osl::MutexGuard pMgrGuard( GetMailMergeMutex() ); + osl::MutexGuard aMgrGuard( GetMailMergeMutex() ); if (m_pMgr) m_pMgr->MergeCancel(); } diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index dc3c67193f23..4cc3c0871713 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -119,17 +119,17 @@ bool SwContentTree::bIsInDrag = false; namespace { - static bool lcl_IsContent(const SvTreeListEntry* pEntry) + bool lcl_IsContent(const SvTreeListEntry* pEntry) { return static_cast<const SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() == CTYPE_CNT; } - static bool lcl_IsContentType(const SvTreeListEntry* pEntry) + bool lcl_IsContentType(const SvTreeListEntry* pEntry) { return static_cast<const SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() == CTYPE_CTT; } - static bool lcl_FindShell(SwWrtShell* pShell) + bool lcl_FindShell(SwWrtShell* pShell) { bool bFound = false; SwView *pView = SwModule::GetFirstView(); @@ -145,7 +145,7 @@ namespace return bFound; } - static bool lcl_IsUiVisibleBookmark(const IDocumentMarkAccess::pMark_t& rpMark) + bool lcl_IsUiVisibleBookmark(const IDocumentMarkAccess::pMark_t& rpMark) { return IDocumentMarkAccess::GetType(*rpMark) == IDocumentMarkAccess::MarkType::BOOKMARK; } @@ -217,8 +217,6 @@ SwTOXBaseContent::~SwTOXBaseContent() { } -// Content type, knows it's contents and the WrtShell. - SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 nLevel) : SwTypeNumber(CTYPE_CTT), pWrtShell(pShell), @@ -457,8 +455,6 @@ SwContentType::~SwContentType() delete pMember; } -// Deliver content, for that if necessary fill the list - const SwContent* SwContentType::GetMember(size_t nIndex) { if(!bDataValid || !pMember) @@ -471,14 +467,12 @@ const SwContent* SwContentType::GetMember(size_t nIndex) return nullptr; } -void SwContentType::Invalidate() +void SwContentType::Invalidate() { bDataValid = false; } -// Fill the List of contents - -void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) +void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) { SwContentArr* pOldMember = nullptr; size_t nOldMemberCount = 0; @@ -538,7 +532,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) for(size_t i = 0; i < nMemberCount; ++i) { const SwFrameFormat& rTableFormat = pWrtShell->GetTableFrameFormat(i, true); - const OUString sTableName( rTableFormat.GetName() ); + const OUString& sTableName( rTableFormat.GetName() ); SwContent* pCnt = new SwContent(this, sTableName, rTableFormat.FindLayoutRect(false, &aNullPt).Top() ); @@ -563,14 +557,13 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) eType = FLYCNTTYPE_OLE; else if(nContentType == ContentTypeId::GRAPHIC) eType = FLYCNTTYPE_GRF; + OSL_ENSURE(nMemberCount == pWrtShell->GetFlyCount(eType, /*bIgnoreTextBoxes=*/true), + "MemberCount differs"); Point aNullPt; nMemberCount = pWrtShell->GetFlyCount(eType, /*bIgnoreTextBoxes=*/true); - std::vector<SwFrameFormat const*> formats(pWrtShell->GetFlyFrameFormats(eType, /*bIgnoreTextBoxes=*/true)); - SAL_WARN_IF(nMemberCount != formats.size(), "sw.ui", "MemberCount differs"); - nMemberCount = formats.size(); - for (size_t i = 0; i < nMemberCount; ++i) + for(size_t i = 0; i < nMemberCount; ++i) { - SwFrameFormat const*const pFrameFormat = formats[i]; + const SwFrameFormat* pFrameFormat = pWrtShell->GetFlyNum(i,eType,/*bIgnoreTextBoxes=*/true); const OUString sFrameName = pFrameFormat->GetName(); SwContent* pCnt; @@ -779,8 +772,6 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) } -// TreeListBox for content indicator - SwContentTree::SwContentTree(vcl::Window* pParent, const ResId& rResId) : SvTreeListBox(pParent, rResId) , m_sSpace(OUString(" ")) @@ -885,9 +876,7 @@ OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const case OBJ_wegFITTEXT: case OBJ_LINE: case OBJ_RECT: - //caoxueqin added custom shape case OBJ_CUSTOMSHAPE: - //end 2005/08/05 case OBJ_CIRC: case OBJ_SECT: case OBJ_CARC: @@ -906,11 +895,10 @@ OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const default: nCmpId = pTemp->GetObjIdentifier(); } - if(nCmpId == OBJ_GRUP /*dynamic_cast< const SdrObjGroup *>( pTemp ) != nullptr*/ && pTemp->GetName() == pCnt->GetName()) + if(nCmpId == OBJ_GRUP && pTemp->GetName() == pCnt->GetName()) { return pTemp->GetTitle(); } - //Commented End } } } @@ -921,13 +909,7 @@ OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const { const SwFlyFrameFormat* pFrameFormat = m_pActiveShell->GetDoc()->FindFlyByName( pCnt->GetName()); if( pFrameFormat ) - { -// SwNodeIndex aIdx( *(pFrameFormat->GetContent().GetContentIdx()), 1 ); -// const SwGrfNode* pGrfNd = aIdx.GetNode().GetGrfNode(); -// if( pGrfNd ) -// return pGrfNd->GetAlternateText(); return pFrameFormat->GetObjTitle(); - } } } break; @@ -978,9 +960,7 @@ OUString SwContentTree::GetEntryLongDescription( SvTreeListEntry* pEntry ) const case OBJ_wegFITTEXT: case OBJ_LINE: case OBJ_RECT: - //caoxueqin added custom shape case OBJ_CUSTOMSHAPE: - //end 2005/08/05 case OBJ_CIRC: case OBJ_SECT: case OBJ_CARC: @@ -1003,7 +983,6 @@ OUString SwContentTree::GetEntryLongDescription( SvTreeListEntry* pEntry ) const { return pTemp->GetDescription(); } - //Commented End } } } @@ -1302,7 +1281,7 @@ sal_IntPtr SwContentTree::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab) // Content will be integrated into the Box only on demand. -void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) +void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) { // Is this a content type? if(lcl_IsContentType(pParent)) @@ -1379,7 +1358,6 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) bool Marked = pDrawView->IsObjMarked(pObj); if(Marked) { - //sEntry += String::CreateFromAscii(" *"); pChild->SetMarked(true); } } @@ -1391,7 +1369,6 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) } } -//Get drawing Objects by content . SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt) { SdrObject *pRetObj = nullptr; @@ -1424,8 +1401,6 @@ SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt) return pRetObj; } -// Expand - Remember the state for content types. - bool SwContentTree::Expand( SvTreeListEntry* pParent ) { if(!m_bIsRoot || (static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) || @@ -1444,7 +1419,7 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent ) m_nHiddenBlock |= nOr; if((pCntType->GetType() == ContentTypeId::OUTLINE)) { - std::map< void*, bool > mCurrOutLineNodeMap; + std::map< void*, bool > aCurrOutLineNodeMap; SwWrtShell* pShell = GetWrtShell(); bool bBool = SvTreeListBox::Expand(pParent); @@ -1455,17 +1430,17 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent ) { sal_Int32 nPos = static_cast<SwContent*>(pChild->GetUserData())->GetYPos(); void* key = static_cast<void*>(pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos )); - mCurrOutLineNodeMap.insert(std::map<void*, bool>::value_type( key, false ) ); + aCurrOutLineNodeMap.insert(std::map<void*, bool>::value_type( key, false ) ); std::map<void*, bool>::iterator iter = mOutLineNodeMap.find( key ); if( iter != mOutLineNodeMap.end() && mOutLineNodeMap[key]) { - mCurrOutLineNodeMap[key] = true; + aCurrOutLineNodeMap[key] = true; SvTreeListBox::Expand(pChild); } } pChild = Next(pChild); } - mOutLineNodeMap = mCurrOutLineNodeMap; + mOutLineNodeMap = aCurrOutLineNodeMap; return bBool; } @@ -1481,8 +1456,6 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent ) return SvTreeListBox::Expand(pParent); } -// Collapse - Remember the state for content types. - bool SwContentTree::Collapse( SvTreeListEntry* pParent ) { if(!m_bIsRoot || (static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) || @@ -1542,8 +1515,6 @@ IMPL_LINK_NOARG_TYPED(SwContentTree, ContentDoubleClickHdl, SvTreeListBox*, bool return false; } -// Show the file - void SwContentTree::Display( bool bActive ) { if(!m_bIsImageListInitialized) @@ -1751,8 +1722,6 @@ void SwContentTree::Display( bool bActive ) m_bActiveDocModified = false; } -// In the Clear the content types have to be deleted, also. - void SwContentTree::Clear() { SetUpdateMode(false); @@ -1812,7 +1781,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, case ContentTypeId::POSTIT: case ContentTypeId::INDEX: case ContentTypeId::REFERENCE : - // cannot inserted as URL or as koennen weder als URL noch als region + // cannot be inserted, neither as URL nor as region break; case ContentTypeId::URLFIELD: sUrl = static_cast<SwURLFieldContent*>(pCnt)->GetURL(); @@ -1932,8 +1901,6 @@ bool SwContentTree::ToggleToRoot() return m_bIsRoot; } -// Check if the displayed content is valid. - bool SwContentTree::HasContentChanged() { @@ -2147,9 +2114,6 @@ bool SwContentTree::HasContentChanged() return bRepaint; } -// Before any data will be deleted, the last active entry has to be found. -// After this the UserData will be deleted - void SwContentTree::FindActiveTypeAndRemoveUserData() { SvTreeListEntry* pEntry = FirstSelected(); @@ -2171,9 +2135,6 @@ void SwContentTree::FindActiveTypeAndRemoveUserData() } } -// After a file is dropped on the Navigator, -// the new shell will be set. - void SwContentTree::SetHiddenShell(SwWrtShell* pSh) { m_pHiddenShell = pSh; @@ -2189,8 +2150,6 @@ void SwContentTree::SetHiddenShell(SwWrtShell* pSh) GetParentWindow()->UpdateListBox(); } -// Document change - set new Shell - void SwContentTree::SetActiveShell(SwWrtShell* pSh) { if(m_bIsInternalDrag) @@ -2228,8 +2187,6 @@ void SwContentTree::SetActiveShell(SwWrtShell* pSh) } } -// Set an open view as active. - void SwContentTree::SetConstantShell(SwWrtShell* pSh) { if (m_pActiveShell) @@ -2247,7 +2204,6 @@ void SwContentTree::SetConstantShell(SwWrtShell* pSh) } - void SwContentTree::Notify(SfxBroadcaster & rBC, SfxHint const& rHint) { SfxSimpleHint const*const pHint(dynamic_cast<SfxSimpleHint const*>(&rHint)); @@ -2272,8 +2228,6 @@ void SwContentTree::Notify(SfxBroadcaster & rBC, SfxHint const& rHint) } } -// Execute commands of the Navigator - void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier) { bool bMove = false; @@ -2376,8 +2330,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier) pEntry = Prev(pEntry); if(pEntry && (nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel()|| - CTYPE_CNT != - static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId())) + CTYPE_CNT != static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId())) { break; } @@ -2423,7 +2376,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier) } } -void SwContentTree::ShowTree() +void SwContentTree::ShowTree() { SvTreeListBox::Show(); } @@ -2437,16 +2390,13 @@ void SwContentTree::Paint( vcl::RenderContext& rRenderContext, SvTreeListBox::Paint( rRenderContext, rRect ); } -// folded together will not be glidled - -void SwContentTree::HideTree() +void SwContentTree::HideTree() { m_aUpdTimer.Stop(); SvTreeListBox::Hide(); } -// No idle with focus or while dragging. - +/** No idle with focus or while dragging */ IMPL_LINK_NOARG_TYPED(SwContentTree, TimerUpdate, Timer *, void) { if (IsDisposed()) @@ -2499,8 +2449,8 @@ DragDropMode SwContentTree::NotifyStartDrag( { DragDropMode eMode = (DragDropMode)0; if( m_bIsActive && m_nRootType == ContentTypeId::OUTLINE && - GetModel()->GetAbsPos( pEntry ) > 0 - && !GetWrtShell()->GetView().GetDocShell()->IsReadOnly()) + GetModel()->GetAbsPos( pEntry ) > 0 + && !GetWrtShell()->GetView().GetDocShell()->IsReadOnly()) eMode = GetDragDropMode(); else if(!m_bIsActive && GetWrtShell()->GetView().GetDocShell()->HasName()) eMode = DragDropMode::APP_COPY; @@ -2594,7 +2544,7 @@ bool SwContentTree::NotifyAcceptDrop( SvTreeListEntry* pEntry) // If a Ctrl + DoubleClick are executed in an open area, // then the base function of the control is to be called. -void SwContentTree::MouseButtonDown( const MouseEvent& rMEvt ) +void SwContentTree::MouseButtonDown( const MouseEvent& rMEvt ) { Point aPos( rMEvt.GetPosPixel()); SvTreeListEntry* pEntry = GetEntry( aPos, true ); @@ -2606,7 +2556,7 @@ void SwContentTree::MouseButtonDown( const MouseEvent& rMEvt ) // Update immediately -void SwContentTree::GetFocus() +void SwContentTree::GetFocus() { SwView* pActView = GetParentWindow()->GetCreateView(); if(pActView) @@ -2630,7 +2580,7 @@ void SwContentTree::GetFocus() SvTreeListBox::GetFocus(); } -void SwContentTree::KeyInput(const KeyEvent& rEvent) +void SwContentTree::KeyInput(const KeyEvent& rEvent) { const vcl::KeyCode aCode = rEvent.GetKeyCode(); if(aCode.GetCode() == KEY_RETURN) @@ -2765,12 +2715,10 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent) } if ( !hasObjectMarked ) { - SwEditWin& pEditWindow = - m_pActiveShell->GetView().GetEditWin(); + SwEditWin& rEditWindow = m_pActiveShell->GetView().GetEditWin(); vcl::KeyCode tempKeycode( KEY_ESCAPE ); KeyEvent rKEvt( 0 , tempKeycode ); - static_cast<vcl::Window*>(&pEditWindow)->KeyInput( rKEvt ); - //rView.GetEditWin().GrabFocus(); + static_cast<vcl::Window*>(&rEditWindow)->KeyInput( rKEvt ); } } } @@ -2788,7 +2736,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent) } -void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) +void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) { bool bCallBase = true; if( rHEvt.GetMode() & HelpEventMode::QUICK ) @@ -2904,7 +2852,7 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) Window::RequestHelp( rHEvt ); } -void SwContentTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) +void SwContentTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) { SvTreeListEntry* pFirst = FirstSelected(); switch( nSelectedPopupEntry ) @@ -3389,7 +3337,6 @@ void SwContentTree::GotoContent(SwContent* pCnt) for( size_t i=0; i<nCount; ++i ) { SdrObject* pTemp = pPage->GetObj(i); - // #i51726# - all drawing objects can be named now if (pTemp->GetName().equals(pCnt->GetName())) { SdrPageView* pPV = pDrawView->GetSdrPageView(); @@ -3494,26 +3441,10 @@ void SwContentLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::Ren rRenderContext.DrawText(rPos, GetText()); rRenderContext.SetFont(aOldFont); } - // IA2 CWS. MT: Removed for now (also in SvLBoxEntry) - only used in Sw/Sd/ScContentLBoxString, they should decide if they need this - /* - else if (rEntry.IsMarked()) - { - rDev.DrawText( rPos, GetText() ); - XubString str; - str = XubString::CreateFromAscii("*"); - Point rPosStar(rPos.X()-6,rPos.Y()); - Font aOldFont( rDev.GetFont()); - Font aFont(aOldFont); - Color aCol( aOldFont.GetColor() ); - aCol.DecreaseLuminance( 200 ); - aFont.SetColor( aCol ); - rDev.SetFont( aFont ); - rDev.DrawText( rPosStar, str); - rDev.SetFont( aOldFont ); - } - */ else + { SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, rEntry); + } } void SwContentTree::DataChanged(const DataChangedEvent& rDCEvt) @@ -3526,6 +3457,7 @@ void SwContentTree::DataChanged(const DataChangedEvent& rDCEvt) m_bIsImageListInitialized = false; Display(true); } + SvTreeListBox::DataChanged( rDCEvt ); } diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx index 1bfd535c8965..c73884a637d2 100644 --- a/sw/source/uibase/utlui/gloslst.cxx +++ b/sw/source/uibase/utlui/gloslst.cxx @@ -137,11 +137,11 @@ bool SwGlossaryList::GetShortName(const OUString& rLongName, if(rLongName != sLong) continue; - TripleString pTriple; - pTriple.sGroup = pGroup->sName; - pTriple.sBlock = sLong; - pTriple.sShort = pGroup->sShortNames.getToken(j, STRING_DELIM); - aTripleStrings.push_back(pTriple); + TripleString aTriple; + aTriple.sGroup = pGroup->sName; + aTriple.sBlock = sLong; + aTriple.sShort = pGroup->sShortNames.getToken(j, STRING_DELIM); + aTripleStrings.push_back(aTriple); } } @@ -149,9 +149,9 @@ bool SwGlossaryList::GetShortName(const OUString& rLongName, nCount = aTripleStrings.size(); if(1 == nCount) { - const TripleString& pTriple(aTripleStrings.front()); - rShortName = pTriple.sShort; - rGroupName = pTriple.sGroup; + const TripleString& rTriple(aTripleStrings.front()); + rShortName = rTriple.sShort; + rGroupName = rTriple.sGroup; bRet = true; } else if(1 < nCount) @@ -168,9 +168,9 @@ bool SwGlossaryList::GetShortName(const OUString& rLongName, if(RET_OK == aDlg->Execute() && LISTBOX_ENTRY_NOTFOUND != rLB.GetSelectEntryPos()) { - const TripleString& pTriple(aTripleStrings[rLB.GetSelectEntryPos()]); - rShortName = pTriple.sShort; - rGroupName = pTriple.sGroup; + const TripleString& rTriple(aTripleStrings[rLB.GetSelectEntryPos()]); + rShortName = rTriple.sShort; + rGroupName = rTriple.sGroup; bRet = true; } else diff --git a/vbahelper/source/vbahelper/vbalineformat.cxx b/vbahelper/source/vbahelper/vbalineformat.cxx index f0229e472faa..f236b0a91af0 100644 --- a/vbahelper/source/vbahelper/vbalineformat.cxx +++ b/vbahelper/source/vbahelper/vbalineformat.cxx @@ -350,64 +350,64 @@ ScVbaLineFormat::setDashStyle( sal_Int32 _dashstyle ) throw (uno::RuntimeExcepti else { m_xPropertySet->setPropertyValue( "LineStyle" , uno::makeAny( drawing::LineStyle_DASH ) ); - drawing::LineDash pLineDash; + drawing::LineDash aLineDash; Millimeter aMillimeter( m_nLineWeight ); sal_Int32 nPixel = static_cast< sal_Int32 >( aMillimeter.getInHundredthsOfOneMillimeter() ); switch( _dashstyle ) { case office::MsoLineDashStyle::msoLineDashDot: - pLineDash.Dots = 1; - pLineDash.DotLen = nPixel; - pLineDash.Dashes = 1; - pLineDash.DashLen = 5 * nPixel; - pLineDash.Distance = 4 * nPixel; + aLineDash.Dots = 1; + aLineDash.DotLen = nPixel; + aLineDash.Dashes = 1; + aLineDash.DashLen = 5 * nPixel; + aLineDash.Distance = 4 * nPixel; break; case office::MsoLineDashStyle::msoLineLongDashDot: - pLineDash.Dots = 1; - pLineDash.DotLen = nPixel; - pLineDash.Dashes = 1; - pLineDash.DashLen = 10 * nPixel; - pLineDash.Distance = 4 * nPixel; + aLineDash.Dots = 1; + aLineDash.DotLen = nPixel; + aLineDash.Dashes = 1; + aLineDash.DashLen = 10 * nPixel; + aLineDash.Distance = 4 * nPixel; break; case office::MsoLineDashStyle::msoLineDash: - pLineDash.Dots = 0; - pLineDash.DotLen = 0; - pLineDash.Dashes = 1; - pLineDash.DashLen = 6 * nPixel; - pLineDash.Distance = 4 * nPixel; + aLineDash.Dots = 0; + aLineDash.DotLen = 0; + aLineDash.Dashes = 1; + aLineDash.DashLen = 6 * nPixel; + aLineDash.Distance = 4 * nPixel; break; case office::MsoLineDashStyle::msoLineDashDotDot: - pLineDash.Dots = 2; - pLineDash.DotLen = nPixel; - pLineDash.Dashes = 1; - pLineDash.DashLen = 10 * nPixel; - pLineDash.Distance = 3 * nPixel; + aLineDash.Dots = 2; + aLineDash.DotLen = nPixel; + aLineDash.Dashes = 1; + aLineDash.DashLen = 10 * nPixel; + aLineDash.Distance = 3 * nPixel; break; case office::MsoLineDashStyle::msoLineLongDash: - pLineDash.Dots = 0; - pLineDash.DotLen = 0; - pLineDash.Dashes = 1; - pLineDash.DashLen = 10 * nPixel; - pLineDash.Distance = 4 * nPixel; + aLineDash.Dots = 0; + aLineDash.DotLen = 0; + aLineDash.Dashes = 1; + aLineDash.DashLen = 10 * nPixel; + aLineDash.Distance = 4 * nPixel; break; case office::MsoLineDashStyle::msoLineSquareDot: - pLineDash.Dots = 1; - pLineDash.DotLen = nPixel; - pLineDash.Dashes = 0; - pLineDash.DashLen = 0; - pLineDash.Distance = nPixel; + aLineDash.Dots = 1; + aLineDash.DotLen = nPixel; + aLineDash.Dashes = 0; + aLineDash.DashLen = 0; + aLineDash.Distance = nPixel; break; case office::MsoLineDashStyle::msoLineRoundDot: - pLineDash.Dots = 1; - pLineDash.DotLen = nPixel; - pLineDash.Dashes = 0; - pLineDash.DashLen = 0; - pLineDash.Distance = nPixel; + aLineDash.Dots = 1; + aLineDash.DotLen = nPixel; + aLineDash.Dashes = 0; + aLineDash.DashLen = 0; + aLineDash.Distance = nPixel; break; default: throw uno::RuntimeException( "this MsoLineDashStyle is not supported." ); } - m_xPropertySet->setPropertyValue( "LineDash" , uno::makeAny( pLineDash ) ); + m_xPropertySet->setPropertyValue( "LineDash" , uno::makeAny( aLineDash ) ); } } diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx index 63e39b8f34fc..b21643f8880d 100644 --- a/vcl/opengl/texture.cxx +++ b/vcl/opengl/texture.cxx @@ -531,9 +531,9 @@ void OpenGLTexture::Unbind() void OpenGLTexture::SaveToFile(const OUString& rFileName) { - std::vector<sal_uInt8> pBuffer(GetWidth() * GetHeight() * 4); - Read(GL_BGRA, GL_UNSIGNED_BYTE, pBuffer.data()); - BitmapEx aBitmap = OpenGLHelper::ConvertBGRABufferToBitmapEx(pBuffer.data(), GetWidth(), GetHeight()); + std::vector<sal_uInt8> aBuffer(GetWidth() * GetHeight() * 4); + Read(GL_BGRA, GL_UNSIGNED_BYTE, aBuffer.data()); + BitmapEx aBitmap = OpenGLHelper::ConvertBGRABufferToBitmapEx(aBuffer.data(), GetWidth(), GetHeight()); try { vcl::PNGWriter aWriter(aBitmap); diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 19570ceb5967..4f9e3e737cda 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -23,12 +23,12 @@ #include "tools/diagnose_ex.h" #include "tools/time.hxx" -#include "vcl/window.hxx" -#include "vcl/event.hxx" -#include "vcl/svapp.hxx" -#include "vcl/wrkwin.hxx" -#include "vcl/help.hxx" -#include "vcl/settings.hxx" +#include <vcl/window.hxx> +#include <vcl/event.hxx> +#include <vcl/svapp.hxx> +#include <vcl/wrkwin.hxx> +#include <vcl/help.hxx> +#include <vcl/settings.hxx> #include "helpwin.hxx" #include "salframe.hxx" diff --git a/vcl/source/bitmap/BitmapProcessor.cxx b/vcl/source/bitmap/BitmapProcessor.cxx index 44a0f7d54bea..68a50bdd80e7 100644 --- a/vcl/source/bitmap/BitmapProcessor.cxx +++ b/vcl/source/bitmap/BitmapProcessor.cxx @@ -137,9 +137,9 @@ void BitmapProcessor::colorizeImage(BitmapEx& rBitmapEx, Color aColor) BitmapColor aBitmapColor; const long nW = pWriteAccess->Width(); const long nH = pWriteAccess->Height(); - std::vector<sal_uInt8> pMapR(256); - std::vector<sal_uInt8> pMapG(256); - std::vector<sal_uInt8> pMapB(256); + std::vector<sal_uInt8> aMapR(256); + std::vector<sal_uInt8> aMapG(256); + std::vector<sal_uInt8> aMapB(256); long nX; long nY; @@ -149,9 +149,9 @@ void BitmapProcessor::colorizeImage(BitmapEx& rBitmapEx, Color aColor) for (nX = 0; nX < 256; ++nX) { - pMapR[nX] = MinMax((nX + cR) / 2, 0, 255); - pMapG[nX] = MinMax((nX + cG) / 2, 0, 255); - pMapB[nX] = MinMax((nX + cB) / 2, 0, 255); + aMapR[nX] = MinMax((nX + cR) / 2, 0, 255); + aMapG[nX] = MinMax((nX + cG) / 2, 0, 255); + aMapB[nX] = MinMax((nX + cB) / 2, 0, 255); } if (pWriteAccess->HasPalette()) @@ -159,9 +159,9 @@ void BitmapProcessor::colorizeImage(BitmapEx& rBitmapEx, Color aColor) for (sal_uInt16 i = 0, nCount = pWriteAccess->GetPaletteEntryCount(); i < nCount; i++) { const BitmapColor& rCol = pWriteAccess->GetPaletteColor(i); - aBitmapColor.SetRed(pMapR[rCol.GetRed()]); - aBitmapColor.SetGreen(pMapG[rCol.GetGreen()]); - aBitmapColor.SetBlue(pMapB[rCol.GetBlue()]); + aBitmapColor.SetRed(aMapR[rCol.GetRed()]); + aBitmapColor.SetGreen(aMapG[rCol.GetGreen()]); + aBitmapColor.SetBlue(aMapB[rCol.GetBlue()]); pWriteAccess->SetPaletteColor(i, aBitmapColor); } } @@ -173,9 +173,9 @@ void BitmapProcessor::colorizeImage(BitmapEx& rBitmapEx, Color aColor) for (nX = 0; nX < nW; ++nX) { - *pScan = pMapB[*pScan]; pScan++; - *pScan = pMapG[*pScan]; pScan++; - *pScan = pMapR[*pScan]; pScan++; + *pScan = aMapB[*pScan]; pScan++; + *pScan = aMapG[*pScan]; pScan++; + *pScan = aMapR[*pScan]; pScan++; } } } @@ -186,9 +186,9 @@ void BitmapProcessor::colorizeImage(BitmapEx& rBitmapEx, Color aColor) for (nX = 0; nX < nW; ++nX) { aBitmapColor = pWriteAccess->GetPixel(nY, nX); - aBitmapColor.SetRed(pMapR[aBitmapColor.GetRed()]); - aBitmapColor.SetGreen(pMapG[aBitmapColor.GetGreen()]); - aBitmapColor.SetBlue(pMapB[aBitmapColor.GetBlue()]); + aBitmapColor.SetRed(aMapR[aBitmapColor.GetRed()]); + aBitmapColor.SetGreen(aMapG[aBitmapColor.GetGreen()]); + aBitmapColor.SetBlue(aMapB[aBitmapColor.GetBlue()]); pWriteAccess->SetPixel(nY, nX, aBitmapColor); } } diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx index a82b95ca924c..e9aef95fb00d 100644 --- a/vcl/source/bitmap/BitmapTools.cxx +++ b/vcl/source/bitmap/BitmapTools.cxx @@ -35,11 +35,11 @@ void BitmapTools::loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx const uno::Reference<graphic::XSvgParser> xSvgParser = graphic::SvgTools::create(xContext); sal_Size nSize = rStream.remainingSize(); - std::vector<sal_Int8> pBuffer(nSize + 1); - rStream.Read(pBuffer.data(), nSize); - pBuffer[nSize] = 0; + std::vector<sal_Int8> aBuffer(nSize + 1); + rStream.Read(aBuffer.data(), nSize); + aBuffer[nSize] = 0; - uno::Sequence<sal_Int8> aData(pBuffer.data(), nSize + 1); + uno::Sequence<sal_Int8> aData(aBuffer.data(), nSize + 1); uno::Reference<io::XInputStream> aInputStream(new comphelper::SequenceInputStream(aData)); Primitive2DSequence aPrimitiveSequence = xSvgParser->getDecomposition(aInputStream, sPath); diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx index a3b32c8287c8..841e5cc78433 100644 --- a/vcl/source/edit/textdata.cxx +++ b/vcl/source/edit/textdata.cxx @@ -164,9 +164,9 @@ sal_uInt16 TEParaPortion::GetLineNumber( sal_Int32 nChar, bool bInclEnd ) { for ( size_t nLine = 0; nLine < maLines.size(); nLine++ ) { - TextLine& pLine = maLines[ nLine ]; - if ( ( bInclEnd && ( pLine.GetEnd() >= nChar ) ) || - ( pLine.GetEnd() > nChar ) ) + TextLine& rLine = maLines[ nLine ]; + if ( ( bInclEnd && ( rLine.GetEnd() >= nChar ) ) || + ( rLine.GetEnd() > nChar ) ) { return nLine; } @@ -184,10 +184,10 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormat DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" ); if ( nLastFormattedLine < ( nLines - 1 ) ) { - const TextLine& pLastFormatted = maLines[ nLastFormattedLine ]; - const TextLine& pUnformatted = maLines[ nLastFormattedLine+1 ]; - short nPortionDiff = pUnformatted.GetStartPortion() - pLastFormatted.GetEndPortion(); - sal_Int32 nTextDiff = pUnformatted.GetStart() - pLastFormatted.GetEnd(); + const TextLine& rLastFormatted = maLines[ nLastFormattedLine ]; + const TextLine& rUnformatted = maLines[ nLastFormattedLine+1 ]; + short nPortionDiff = rUnformatted.GetStartPortion() - rLastFormatted.GetEndPortion(); + sal_Int32 nTextDiff = rUnformatted.GetStart() - rLastFormatted.GetEnd(); nTextDiff++; // LastFormatted.GetEnd() was inclusive => subtracted one too much! // The first unformatted one has to start exactly one portion past the last @@ -199,15 +199,15 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormat { for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ ) { - TextLine& pLine = maLines[ nL ]; + TextLine& rLine = maLines[ nL ]; - pLine.GetStartPortion() = pLine.GetStartPortion() + nPDiff; - pLine.GetEndPortion() = pLine.GetEndPortion() + nPDiff; + rLine.GetStartPortion() = rLine.GetStartPortion() + nPDiff; + rLine.GetEndPortion() = rLine.GetEndPortion() + nPDiff; - pLine.GetStart() = pLine.GetStart() + nTDiff; - pLine.GetEnd() = pLine.GetEnd() + nTDiff; + rLine.GetStart() = rLine.GetStart() + nTDiff; + rLine.GetEnd() = rLine.GetEnd() + nTDiff; - pLine.SetValid(); + rLine.SetValid(); } } } diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index fec262f51e44..3cfa63c13c06 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -270,8 +270,8 @@ OUString TextEngine::GetTextLines( LineEnd aSeparator ) const const size_t nLines = pTEParaPortion->GetLines().size(); for ( size_t nL = 0; nL < nLines; ++nL ) { - TextLine& pLine = pTEParaPortion->GetLines()[nL]; - aText += pTEParaPortion->GetNode()->GetText().copy( pLine.GetStart(), pLine.GetEnd() - pLine.GetStart() ); + TextLine& rLine = pTEParaPortion->GetLines()[nL]; + aText += pTEParaPortion->GetNode()->GetText().copy( rLine.GetStart(), rLine.GetEnd() - rLine.GetStart() ); if ( pSep && ( ( (nP+1) < nParas ) || ( (nL+1) < nLines ) ) ) aText += pSep; } @@ -895,14 +895,14 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, bool bSpecial, bool bP TextLine* pLine = nullptr; for ( size_t nLine = 0; nLine < pPortion->GetLines().size(); nLine++ ) { - TextLine& pTmpLine = pPortion->GetLines()[ nLine ]; - if ( ( pTmpLine.GetStart() == rPaM.GetIndex() ) || ( pTmpLine.IsIn( rPaM.GetIndex(), bSpecial ) ) ) + TextLine& rTmpLine = pPortion->GetLines()[ nLine ]; + if ( ( rTmpLine.GetStart() == rPaM.GetIndex() ) || ( rTmpLine.IsIn( rPaM.GetIndex(), bSpecial ) ) ) { - pLine = &pTmpLine; + pLine = &rTmpLine; break; } - nCurIndex = nCurIndex + pTmpLine.GetLen(); + nCurIndex = nCurIndex + rTmpLine.GetLen(); nY += mnCharHeight; } if ( !pLine ) @@ -1076,11 +1076,11 @@ sal_Int32 TextEngine::ImpFindIndex( sal_uInt32 nPortion, const Point& rPosInPara sal_uInt16 nLine; for ( nLine = 0; nLine < pPortion->GetLines().size(); nLine++ ) { - TextLine& pTmpLine = pPortion->GetLines()[ nLine ]; + TextLine& rmpLine = pPortion->GetLines()[ nLine ]; nY += mnCharHeight; if ( nY > rPosInPara.Y() ) // that's it { - pLine = &pTmpLine; + pLine = &rmpLine; break; // correct Y-Position not needed } } @@ -1103,15 +1103,15 @@ sal_Int32 TextEngine::GetCharPos( sal_uInt32 nPortion, sal_uInt16 nLine, long nX { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion ); - TextLine& pLine = pPortion->GetLines()[ nLine ]; + TextLine& rLine = pPortion->GetLines()[ nLine ]; - sal_Int32 nCurIndex = pLine.GetStart(); + sal_Int32 nCurIndex = rLine.GetStart(); - long nTmpX = pLine.GetStartX(); + long nTmpX = rLine.GetStartX(); if ( nXPos <= nTmpX ) return nCurIndex; - for ( sal_uInt16 i = pLine.GetStartPortion(); i <= pLine.GetEndPortion(); i++ ) + for ( sal_uInt16 i = rLine.GetStartPortion(); i <= rLine.GetEndPortion(); i++ ) { TETextPortion* pTextPortion = pPortion->GetTextPortions()[ i ]; nTmpX += pTextPortion->GetWidth(); @@ -1165,8 +1165,8 @@ long TextEngine::CalcTextWidth( sal_uInt32 nPara ) for ( auto nLine = pPortion->GetLines().size(); nLine; ) { long nLineWidth = 0; - TextLine& pLine = pPortion->GetLines()[ --nLine ]; - for ( sal_uInt16 nTP = pLine.GetStartPortion(); nTP <= pLine.GetEndPortion(); nTP++ ) + TextLine& rLine = pPortion->GetLines()[ --nLine ]; + for ( sal_uInt16 nTP = rLine.GetStartPortion(); nTP <= rLine.GetEndPortion(); nTP++ ) { TETextPortion* pTextPortion = pPortion->GetTextPortions()[ nTP ]; nLineWidth += pTextPortion->GetWidth(); @@ -1282,8 +1282,8 @@ Range TextEngine::GetInvalidYOffsets( sal_uInt32 nPortion ) sal_uInt16 nLine; for ( nLine = 0; nLine < nLines; nLine++ ) { - TextLine& pL = pTEParaPortion->GetLines()[ nLine ]; - if ( pL.IsInvalid() ) + TextLine& rL = pTEParaPortion->GetLines()[ nLine ]; + if ( rL.IsInvalid() ) { nFirstInvalid = nLine; break; @@ -1292,8 +1292,8 @@ Range TextEngine::GetInvalidYOffsets( sal_uInt32 nPortion ) for ( nLastInvalid = nFirstInvalid; nLastInvalid < nLines; nLastInvalid++ ) { - TextLine& pL = pTEParaPortion->GetLines()[ nLine ]; - if ( pL.IsValid() ) + TextLine& rL = pTEParaPortion->GetLines()[ nLine ]; + if ( rL.IsValid() ) break; } @@ -1950,18 +1950,18 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan { // for all lines of the paragraph sal_Int32 nIndex = 0; - for ( auto &pLine : pPortion->GetLines() ) + for ( auto & rLine : pPortion->GetLines() ) { - Point aTmpPos( rStartPos.X() + pLine.GetStartX(), nY ); + Point aTmpPos( rStartPos.X() + rLine.GetStartX(), nY ); if ( ( !pPaintArea || ( ( nY + mnCharHeight ) > pPaintArea->Top() ) ) && ( !pPaintRange || ( - ( TextPaM( nPara, pLine.GetStart() ) < pPaintRange->GetEnd() ) && - ( TextPaM( nPara, pLine.GetEnd() ) > pPaintRange->GetStart() ) ) ) ) + ( TextPaM( nPara, rLine.GetStart() ) < pPaintRange->GetEnd() ) && + ( TextPaM( nPara, rLine.GetEnd() ) > pPaintRange->GetStart() ) ) ) ) { // for all Portions of the line - nIndex = pLine.GetStart(); - for ( sal_uInt16 y = pLine.GetStartPortion(); y <= pLine.GetEndPortion(); y++ ) + nIndex = rLine.GetStart(); + for ( sal_uInt16 y = rLine.GetStartPortion(); y <= rLine.GetEndPortion(); y++ ) { OSL_ENSURE(pPortion->GetTextPortions().size(), "ImpPaint: Line without Textportion!"); @@ -1971,7 +1971,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan ImpInitLayoutMode( pOutDev /*, pTextPortion->IsRightToLeft() */); long nTxtWidth = pTextPortion->GetWidth(); - aTmpPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &pLine, nIndex, nIndex ); + aTmpPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nIndex, nIndex ); // only print if starting in the visible region if ( ( ( aTmpPos.X() + nTxtWidth ) >= 0 ) @@ -2023,7 +2023,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan { const sal_Int32 nL = pSelStart->GetIndex() - nTmpIndex; pOutDev->SetFont( aFont); - aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &pLine, nTmpIndex, nTmpIndex+nL ); + aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nL ); nTmpIndex = nTmpIndex + nL; @@ -2037,7 +2037,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan Color aOldTextColor = pOutDev->GetTextColor(); pOutDev->SetTextColor( rStyleSettings.GetHighlightTextColor() ); pOutDev->SetTextFillColor( rStyleSettings.GetHighlightColor() ); - aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &pLine, nTmpIndex, nTmpIndex+nL ); + aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nL ); pOutDev->SetTextColor( aOldTextColor ); pOutDev->SetTextFillColor(); @@ -2048,7 +2048,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan if ( nTmpIndex < nEnd ) { nL = nEnd-nTmpIndex; - aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &pLine, nTmpIndex, nTmpIndex+nL ); + aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex ); } bDone = true; @@ -2056,7 +2056,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan } if ( !bDone ) { - aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &pLine, nTmpIndex, nEnd ); + aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nEnd ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex ); } } diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 45cc8544fb33..1baddd57b150 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -418,9 +418,9 @@ void TextView::ImpHighlight( const TextSelection& rSel ) // iterate over all lines for ( sal_uInt16 nLine = nStartLine; nLine <= nEndLine; nLine++ ) { - TextLine& pLine = pTEParaPortion->GetLines()[ nLine ]; - sal_Int32 nStartIndex = pLine.GetStart(); - sal_Int32 nEndIndex = pLine.GetEnd(); + TextLine& rLine = pTEParaPortion->GetLines()[ nLine ]; + sal_Int32 nStartIndex = rLine.GetStart(); + sal_Int32 nEndIndex = rLine.GetEnd(); if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) ) nStartIndex = aSel.GetStart().GetIndex(); if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) ) @@ -1021,9 +1021,9 @@ void TextView::Command( const CommandEvent& rCEvt ) TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); sal_uInt16 nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), true ); - TextLine& pLine = pParaPortion->GetLines()[ nLine ]; - if ( nInputEnd > pLine.GetEnd() ) - nInputEnd = pLine.GetEnd(); + TextLine& rLine = pParaPortion->GetLines()[ nLine ]; + if ( nInputEnd > rLine.GetEnd() ) + nInputEnd = rLine.GetEnd(); Rectangle aR2 = mpImpl->mpTextEngine->PaMtoEditCursor( TextPaM( aPaM.GetPara(), nInputEnd ) ); long nWidth = aR2.Left()-aR1.Right(); @@ -1524,8 +1524,8 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM ) // If we need to go to the end of a line that was wrapped automatically, // the cursor ends up at the beginning of the 2nd line // Problem: Last character of an automatically wrapped line = Cursor - TextLine& pLine = pPPortion->GetLines()[ nLine - 1 ]; - if ( aPaM.GetIndex() && ( aPaM.GetIndex() == pLine.GetEnd() ) ) + TextLine& rLine = pPPortion->GetLines()[ nLine - 1 ]; + if ( aPaM.GetIndex() && ( aPaM.GetIndex() == rLine.GetEnd() ) ) --aPaM.GetIndex(); } else if ( rPaM.GetPara() ) // previous paragraph @@ -1559,8 +1559,8 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM ) aPaM.GetIndex() = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX ); // special case CursorUp - TextLine& pLine = pPPortion->GetLines()[ nLine + 1 ]; - if ( ( aPaM.GetIndex() == pLine.GetEnd() ) && ( aPaM.GetIndex() > pLine.GetStart() ) && aPaM.GetIndex() < pPPortion->GetNode()->GetText().getLength() ) + TextLine& rLine = pPPortion->GetLines()[ nLine + 1 ]; + if ( ( aPaM.GetIndex() == rLine.GetEnd() ) && ( aPaM.GetIndex() > rLine.GetStart() ) && aPaM.GetIndex() < pPPortion->GetNode()->GetText().getLength() ) --aPaM.GetIndex(); } else if ( rPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().size() - 1 ) ) // next paragraph @@ -1568,8 +1568,8 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM ) aPaM.GetPara()++; pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); aPaM.GetIndex() = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 ); - TextLine& pLine = pPPortion->GetLines().front(); - if ( ( aPaM.GetIndex() == pLine.GetEnd() ) && ( aPaM.GetIndex() > pLine.GetStart() ) && ( pPPortion->GetLines().size() > 1 ) ) + TextLine& rLine = pPPortion->GetLines().front(); + if ( ( aPaM.GetIndex() == rLine.GetEnd() ) && ( aPaM.GetIndex() > rLine.GetStart() ) && ( pPPortion->GetLines().size() > 1 ) ) --aPaM.GetIndex(); } @@ -1582,8 +1582,8 @@ TextPaM TextView::CursorStartOfLine( const TextPaM& rPaM ) TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), false ); - TextLine& pLine = pPPortion->GetLines()[ nLine ]; - aPaM.GetIndex() = pLine.GetStart(); + TextLine& rLine = pPPortion->GetLines()[ nLine ]; + aPaM.GetIndex() = rLine.GetStart(); return aPaM; } @@ -1594,10 +1594,10 @@ TextPaM TextView::CursorEndOfLine( const TextPaM& rPaM ) TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), false ); - TextLine& pLine = pPPortion->GetLines()[ nLine ]; - aPaM.GetIndex() = pLine.GetEnd(); + TextLine& rLine = pPPortion->GetLines()[ nLine ]; + aPaM.GetIndex() = rLine.GetEnd(); - if ( pLine.GetEnd() > pLine.GetStart() ) // empty line + if ( rLine.GetEnd() > rLine.GetStart() ) // empty line { sal_Unicode cLastChar = pPPortion->GetNode()->GetText()[ aPaM.GetIndex()-1 ]; if ( ( cLastChar == ' ' ) && ( aPaM.GetIndex() != pPPortion->GetNode()->GetText().getLength() ) ) diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx index 5179f77d0950..ebc8e5e7575c 100644 --- a/vcl/source/filter/ixpm/xpmread.cxx +++ b/vcl/source/filter/ixpm/xpmread.cxx @@ -488,7 +488,7 @@ bool XPMReader::ImplCompare( sal_uInt8 const * pSource, sal_uInt8 const * pDest, bool XPMReader::ImplGetPara ( sal_uLong nNumb ) { sal_uInt8 nByte; - sal_uLong pSize = 0; + sal_uLong nSize = 0; sal_uInt8* pPtr = mpStringBuf; sal_uLong nCount = 0; @@ -504,7 +504,7 @@ bool XPMReader::ImplGetPara ( sal_uLong nNumb ) nCount = 0xffffffff; } - while ( pSize < mnStringSize ) + while ( nSize < mnStringSize ) { nByte = *pPtr; @@ -529,7 +529,7 @@ bool XPMReader::ImplGetPara ( sal_uLong nNumb ) nCount++; } } - pSize++; + nSize++; pPtr++; } return ( ( nCount == nNumb ) && ( mpPara ) ); diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index b4f1000ec172..0c6c50b8c25f 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -718,9 +718,9 @@ bool Bitmap::ImplConvertDown(sal_uInt16 nBitCount, Color* pExtColor) InverseColorMap aColorMap(aPalette); BitmapColor aColor; ImpErrorQuad aErrQuad; - std::vector<ImpErrorQuad> pErrQuad1(nWidth); - std::vector<ImpErrorQuad> pErrQuad2(nWidth); - ImpErrorQuad* pQLine1 = pErrQuad1.data(); + std::vector<ImpErrorQuad> aErrQuad1(nWidth); + std::vector<ImpErrorQuad> aErrQuad2(nWidth); + ImpErrorQuad* pQLine1 = aErrQuad1.data(); ImpErrorQuad* pQLine2 = nullptr; long nYTmp = 0L; sal_uInt8 cIndex; @@ -744,7 +744,7 @@ bool Bitmap::ImplConvertDown(sal_uInt16 nBitCount, Color* pExtColor) for (long nY = 0L; nY < std::min(nHeight, 2L); nY++, nYTmp++) { - pQLine2 = !nY ? pErrQuad1.data() : pErrQuad2.data(); + pQLine2 = !nY ? aErrQuad1.data() : aErrQuad2.data(); for (long nX = 0L; nX < nWidth; nX++) { if (pReadAcc->HasPalette()) @@ -782,7 +782,7 @@ bool Bitmap::ImplConvertDown(sal_uInt16 nBitCount, Color* pExtColor) // Refill/copy row buffer pQLine1 = pQLine2; - pQLine2 = (bQ1 = !bQ1) ? pErrQuad2.data() : pErrQuad1.data(); + pQLine2 = (bQ1 = !bQ1) ? aErrQuad2.data() : aErrQuad1.data(); if (nYTmp < nHeight) { diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 6051b9c97436..ee0bad4d45b1 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2124,11 +2124,11 @@ bool PDFWriterImpl::compressStream( SvMemoryStream* pStream ) pStream->Seek( STREAM_SEEK_TO_END ); sal_uLong nEndPos = pStream->Tell(); pStream->Seek( STREAM_SEEK_TO_BEGIN ); - ZCodec pCodec( 0x4000, 0x4000 ); + ZCodec aCodec( 0x4000, 0x4000 ); SvMemoryStream aStream; - pCodec.BeginCompression(); - pCodec.Write( aStream, static_cast<const sal_uInt8*>(pStream->GetData()), nEndPos ); - pCodec.EndCompression(); + aCodec.BeginCompression(); + aCodec.Write( aStream, static_cast<const sal_uInt8*>(pStream->GetData()), nEndPos ); + aCodec.EndCompression(); nEndPos = aStream.Tell(); pStream->Seek( STREAM_SEEK_TO_BEGIN ); aStream.Seek( STREAM_SEEK_TO_BEGIN ); @@ -3795,11 +3795,11 @@ sal_Int32 PDFWriterImpl::createToUnicodeCMap( sal_uInt8* pEncoding, "end\n" "end\n" ); #ifndef DEBUG_DISABLE_PDFCOMPRESSION - ZCodec pCodec( 0x4000, 0x4000 ); + ZCodec aCodec( 0x4000, 0x4000 ); SvMemoryStream aStream; - pCodec.BeginCompression(); - pCodec.Write( aStream, reinterpret_cast<const sal_uInt8*>(aContents.getStr()), aContents.getLength() ); - pCodec.EndCompression(); + aCodec.BeginCompression(); + aCodec.Write( aStream, reinterpret_cast<const sal_uInt8*>(aContents.getStr()), aContents.getLength() ); + aCodec.EndCompression(); #endif #if OSL_DEBUG_LEVEL > 1 diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index e6d62d305580..46ba15e5ef63 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -341,19 +341,19 @@ static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, sal_uInt16 nId ) sal_uInt16 i; size_t nItems = pSet->mpItems.size(); - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mnId == nId ) - return pItems[i]->mpSet; + if ( rItems[i]->mnId == nId ) + return rItems[i]->mpSet; } for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mpSet ) + if ( rItems[i]->mpSet ) { - ImplSplitSet* pFindSet = ImplFindSet( pItems[i]->mpSet, nId ); + ImplSplitSet* pFindSet = ImplFindSet( rItems[i]->mpSet, nId ); if ( pFindSet ) return pFindSet; } @@ -366,11 +366,11 @@ static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, sal_uInt16 nId, sal_uInt1 { sal_uInt16 i; size_t nItems = pSet->mpItems.size(); - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mnId == nId ) + if ( rItems[i]->mnId == nId ) { rPos = i; return pSet; @@ -379,9 +379,9 @@ static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, sal_uInt16 nId, sal_uInt1 for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mpSet ) + if ( rItems[i]->mpSet ) { - ImplSplitSet* pFindSet = ImplFindItem( pItems[i]->mpSet, nId, rPos ); + ImplSplitSet* pFindSet = ImplFindItem( rItems[i]->mpSet, nId, rPos ); if ( pFindSet ) return pFindSet; } @@ -394,17 +394,17 @@ static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, vcl::Window* pWindow ) { sal_uInt16 i; size_t nItems = pSet->mpItems.size(); - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mpWindow == pWindow ) - return pItems[i]->mnId; + if ( rItems[i]->mpWindow == pWindow ) + return rItems[i]->mnId; else { - if ( pItems[i]->mpSet ) + if ( rItems[i]->mpSet ) { - sal_uInt16 nId = ImplFindItem( pItems[i]->mpSet, pWindow ); + sal_uInt16 nId = ImplFindItem( rItems[i]->mpSet, pWindow ); if ( nId ) return nId; } @@ -419,14 +419,14 @@ static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, const Point& rPos, { sal_uInt16 i; size_t nItems = pSet->mpItems.size(); - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mnWidth && pItems[i]->mnHeight ) + if ( rItems[i]->mnWidth && rItems[i]->mnHeight ) { - Point aPoint( pItems[i]->mnLeft, pItems[i]->mnTop ); - Size aSize( pItems[i]->mnWidth, pItems[i]->mnHeight ); + Point aPoint( rItems[i]->mnLeft, rItems[i]->mnTop ); + Size aSize( rItems[i]->mnWidth, rItems[i]->mnHeight ); Rectangle aRect( aPoint, aSize ); if ( bRows ) { @@ -445,13 +445,13 @@ static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, const Point& rPos, if ( aRect.IsInside( rPos ) ) { - if ( pItems[i]->mpSet && !pItems[i]->mpSet->mpItems.empty() ) + if ( rItems[i]->mpSet && !rItems[i]->mpSet->mpItems.empty() ) { - return ImplFindItem( pItems[i]->mpSet, rPos, - !(pItems[i]->mnBits & SplitWindowItemFlags::ColSet) ); + return ImplFindItem( rItems[i]->mpSet, rPos, + !(rItems[i]->mnBits & SplitWindowItemFlags::ColSet) ); } else - return pItems[i]->mnId; + return rItems[i]->mnId; } } } @@ -477,14 +477,14 @@ static void ImplCalcSet( ImplSplitSet* pSet, long nCalcSize; long nPos; long nMaxPos; - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; bool bEmpty; // get number of visible items nVisItems = 0; for ( i = 0; i < nItems; i++ ) { - if ( !(pItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) + if ( !(rItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) nVisItems++; } @@ -504,14 +504,14 @@ static void ImplCalcSet( ImplSplitSet* pSet, long nCurSize = 0; for ( i = 0; i < nItems; i++ ) { - if ( !(pItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) + if ( !(rItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) { - if ( pItems[i]->mnBits & SplitWindowItemFlags::RelativeSize ) - nRelCount += pItems[i]->mnSize; - else if ( pItems[i]->mnBits & SplitWindowItemFlags::PercentSize ) - nPercent += pItems[i]->mnSize; + if ( rItems[i]->mnBits & SplitWindowItemFlags::RelativeSize ) + nRelCount += rItems[i]->mnSize; + else if ( rItems[i]->mnBits & SplitWindowItemFlags::PercentSize ) + nPercent += rItems[i]->mnSize; else - nAbsSize += pItems[i]->mnSize; + nAbsSize += rItems[i]->mnSize; } } // map relative values to percentages (percentage here one tenth of a procent) @@ -537,25 +537,25 @@ static void ImplCalcSet( ImplSplitSet* pSet, long nSizeDelta = nCalcSize-nAbsSize; for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mnBits & SplitWindowItemFlags::Invisible ) - pItems[i]->mnPixSize = 0; - else if ( pItems[i]->mnBits & SplitWindowItemFlags::RelativeSize ) + if ( rItems[i]->mnBits & SplitWindowItemFlags::Invisible ) + rItems[i]->mnPixSize = 0; + else if ( rItems[i]->mnBits & SplitWindowItemFlags::RelativeSize ) { if ( nSizeDelta <= 0 ) - pItems[i]->mnPixSize = 0; + rItems[i]->mnPixSize = 0; else - pItems[i]->mnPixSize = (nSizeDelta*pItems[i]->mnSize*nRelPercent)/nPercent; + rItems[i]->mnPixSize = (nSizeDelta*rItems[i]->mnSize*nRelPercent)/nPercent; } - else if ( pItems[i]->mnBits & SplitWindowItemFlags::PercentSize ) + else if ( rItems[i]->mnBits & SplitWindowItemFlags::PercentSize ) { if ( nSizeDelta <= 0 ) - pItems[i]->mnPixSize = 0; + rItems[i]->mnPixSize = 0; else - pItems[i]->mnPixSize = (nSizeDelta*pItems[i]->mnSize*nPercentFactor)/nPercent; + rItems[i]->mnPixSize = (nSizeDelta*rItems[i]->mnSize*nPercentFactor)/nPercent; } else - pItems[i]->mnPixSize = pItems[i]->mnSize; - nCurSize += pItems[i]->mnPixSize; + rItems[i]->mnPixSize = rItems[i]->mnSize; + nCurSize += rItems[i]->mnPixSize; } pSet->mbCalcPix = false; @@ -572,12 +572,12 @@ static void ImplCalcSet( ImplSplitSet* pSet, // first resize absolute items relative for ( i = 0; i < nItems; i++ ) { - if ( !(pItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) + if ( !(rItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) { - if ( !(pItems[i]->mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) ) + if ( !(rItems[i]->mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) ) { nAbsItems++; - nSizeWinSize += pItems[i]->mnPixSize; + nSizeWinSize += rItems[i]->mnPixSize; } } } @@ -586,12 +586,12 @@ static void ImplCalcSet( ImplSplitSet* pSet, { for ( i = 0; i < nItems; i++ ) { - if ( !(pItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) + if ( !(rItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) { - if ( !(pItems[i]->mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) ) + if ( !(rItems[i]->mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) ) { - pItems[i]->mnPixSize += (nSizeDelta*pItems[i]->mnPixSize)/nSizeWinSize; - nNewSizeWinSize += pItems[i]->mnPixSize; + rItems[i]->mnPixSize += (nSizeDelta*rItems[i]->mnPixSize)/nSizeWinSize; + nNewSizeWinSize += rItems[i]->mnPixSize; } } } @@ -609,28 +609,28 @@ static void ImplCalcSet( ImplSplitSet* pSet, { for ( i = 0; i < nItems; i++ ) { - pItems[i]->mbSubSize = false; + rItems[i]->mbSubSize = false; if ( j >= 2 ) - pItems[i]->mbSubSize = true; + rItems[i]->mbSubSize = true; else { - if ( !(pItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) + if ( !(rItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) { - if ( (nSizeDelta > 0) || pItems[i]->mnPixSize ) + if ( (nSizeDelta > 0) || rItems[i]->mnPixSize ) { if ( j >= 1 ) - pItems[i]->mbSubSize = true; + rItems[i]->mbSubSize = true; else { - if ( (j == 0) && (pItems[i]->mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) ) - pItems[i]->mbSubSize = true; + if ( (j == 0) && (rItems[i]->mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) ) + rItems[i]->mbSubSize = true; } } } } - if ( pItems[i]->mbSubSize ) + if ( rItems[i]->mbSubSize ) nCalcItems++; } @@ -643,11 +643,11 @@ static void ImplCalcSet( ImplSplitSet* pSet, nMins = 0; for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mnBits & SplitWindowItemFlags::Invisible ) + if ( rItems[i]->mnBits & SplitWindowItemFlags::Invisible ) nMins++; - else if ( pItems[i]->mbSubSize ) + else if ( rItems[i]->mbSubSize ) { - long* pSize = &(pItems[i]->mnPixSize); + long* pSize = &(rItems[i]->mnPixSize); long nTempErr; if ( nErrorSum ) @@ -708,24 +708,24 @@ static void ImplCalcSet( ImplSplitSet* pSet, // order windows and adept values for ( i = 0; i < nItems; i++ ) { - pItems[i]->mnOldSplitPos = pItems[i]->mnSplitPos; - pItems[i]->mnOldSplitSize = pItems[i]->mnSplitSize; - pItems[i]->mnOldWidth = pItems[i]->mnWidth; - pItems[i]->mnOldHeight = pItems[i]->mnHeight; + rItems[i]->mnOldSplitPos = rItems[i]->mnSplitPos; + rItems[i]->mnOldSplitSize = rItems[i]->mnSplitSize; + rItems[i]->mnOldWidth = rItems[i]->mnWidth; + rItems[i]->mnOldHeight = rItems[i]->mnHeight; - if ( pItems[i]->mnBits & SplitWindowItemFlags::Invisible ) + if ( rItems[i]->mnBits & SplitWindowItemFlags::Invisible ) bEmpty = true; else { bEmpty = false; if ( bDown ) { - if ( nPos+pItems[i]->mnPixSize > nMaxPos ) + if ( nPos+rItems[i]->mnPixSize > nMaxPos ) bEmpty = true; } else { - nPos -= pItems[i]->mnPixSize; + nPos -= rItems[i]->mnPixSize; if ( nPos < nMaxPos ) bEmpty = true; } @@ -733,85 +733,85 @@ static void ImplCalcSet( ImplSplitSet* pSet, if ( bEmpty ) { - pItems[i]->mnWidth = 0; - pItems[i]->mnHeight = 0; - pItems[i]->mnSplitSize = 0; + rItems[i]->mnWidth = 0; + rItems[i]->mnHeight = 0; + rItems[i]->mnSplitSize = 0; } else { if ( bRows ) { - pItems[i]->mnLeft = nSetLeft; - pItems[i]->mnTop = nPos; - pItems[i]->mnWidth = nSetWidth; - pItems[i]->mnHeight = pItems[i]->mnPixSize; + rItems[i]->mnLeft = nSetLeft; + rItems[i]->mnTop = nPos; + rItems[i]->mnWidth = nSetWidth; + rItems[i]->mnHeight = rItems[i]->mnPixSize; } else { - pItems[i]->mnLeft = nPos; - pItems[i]->mnTop = nSetTop; - pItems[i]->mnWidth = pItems[i]->mnPixSize; - pItems[i]->mnHeight = nSetHeight; + rItems[i]->mnLeft = nPos; + rItems[i]->mnTop = nSetTop; + rItems[i]->mnWidth = rItems[i]->mnPixSize; + rItems[i]->mnHeight = nSetHeight; } if ( i > nItems-1 ) - pItems[i]->mnSplitSize = 0; + rItems[i]->mnSplitSize = 0; else { - pItems[i]->mnSplitSize = pSet->mnSplitSize; + rItems[i]->mnSplitSize = pSet->mnSplitSize; if ( bDown ) { - pItems[i]->mnSplitPos = nPos+pItems[i]->mnPixSize; - if ( pItems[i]->mnSplitPos+pItems[i]->mnSplitSize > nMaxPos ) - pItems[i]->mnSplitSize = nMaxPos-pItems[i]->mnSplitPos; + rItems[i]->mnSplitPos = nPos+rItems[i]->mnPixSize; + if ( rItems[i]->mnSplitPos+rItems[i]->mnSplitSize > nMaxPos ) + rItems[i]->mnSplitSize = nMaxPos-rItems[i]->mnSplitPos; } else { - pItems[i]->mnSplitPos = nPos-pSet->mnSplitSize; - if ( pItems[i]->mnSplitPos < nMaxPos ) - pItems[i]->mnSplitSize = pItems[i]->mnSplitPos+pSet->mnSplitSize-nMaxPos; + rItems[i]->mnSplitPos = nPos-pSet->mnSplitSize; + if ( rItems[i]->mnSplitPos < nMaxPos ) + rItems[i]->mnSplitSize = rItems[i]->mnSplitPos+pSet->mnSplitSize-nMaxPos; } } } - if ( !(pItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) + if ( !(rItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) { if ( !bDown ) nPos -= pSet->mnSplitSize; else - nPos += pItems[i]->mnPixSize+pSet->mnSplitSize; + nPos += rItems[i]->mnPixSize+pSet->mnSplitSize; } } // calculate Sub-Set's for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mpSet && pItems[i]->mnWidth && pItems[i]->mnHeight ) + if ( rItems[i]->mpSet && rItems[i]->mnWidth && rItems[i]->mnHeight ) { - ImplCalcSet( pItems[i]->mpSet, - pItems[i]->mnLeft, pItems[i]->mnTop, - pItems[i]->mnWidth, pItems[i]->mnHeight, - !(pItems[i]->mnBits & SplitWindowItemFlags::ColSet) ); + ImplCalcSet( rItems[i]->mpSet, + rItems[i]->mnLeft, rItems[i]->mnTop, + rItems[i]->mnWidth, rItems[i]->mnHeight, + !(rItems[i]->mnBits & SplitWindowItemFlags::ColSet) ); } } // set fixed for ( i = 0; i < nItems; i++ ) { - pItems[i]->mbFixed = false; - if ( pItems[i]->mnBits & SplitWindowItemFlags::Fixed ) - pItems[i]->mbFixed = true; + rItems[i]->mbFixed = false; + if ( rItems[i]->mnBits & SplitWindowItemFlags::Fixed ) + rItems[i]->mbFixed = true; else { // this item is also fixed if Child-Set is available, // if a child is fixed - if ( pItems[i]->mpSet ) + if ( rItems[i]->mpSet ) { - for ( j = 0; j < pItems[i]->mpSet->mpItems.size(); j++ ) + for ( j = 0; j < rItems[i]->mpSet->mpItems.size(); j++ ) { - if ( pItems[i]->mpSet->mpItems[j]->mbFixed ) + if ( rItems[i]->mpSet->mpItems[j]->mbFixed ) { - pItems[i]->mbFixed = true; + rItems[i]->mbFixed = true; break; } } @@ -825,63 +825,63 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, bool b { sal_uInt16 i; size_t nItems = pSet->mpItems.size(); - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; if ( pWindow->IsReallyVisible() && pWindow->IsUpdateMode() && pWindow->mbInvalidate ) { for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mnSplitSize ) + if ( rItems[i]->mnSplitSize ) { // invalidate all, if applicable or only a small part - if ( (pItems[i]->mnOldSplitPos != pItems[i]->mnSplitPos) || - (pItems[i]->mnOldSplitSize != pItems[i]->mnSplitSize) || - (pItems[i]->mnOldWidth != pItems[i]->mnWidth) || - (pItems[i]->mnOldHeight != pItems[i]->mnHeight) ) + if ( (rItems[i]->mnOldSplitPos != rItems[i]->mnSplitPos) || + (rItems[i]->mnOldSplitSize != rItems[i]->mnSplitSize) || + (rItems[i]->mnOldWidth != rItems[i]->mnWidth) || + (rItems[i]->mnOldHeight != rItems[i]->mnHeight) ) { Rectangle aRect; // invalidate old rectangle if ( bRows ) { - aRect.Left() = pItems[i]->mnLeft; - aRect.Right() = pItems[i]->mnLeft+pItems[i]->mnOldWidth-1; - aRect.Top() = pItems[i]->mnOldSplitPos; - aRect.Bottom() = aRect.Top() + pItems[i]->mnOldSplitSize; + aRect.Left() = rItems[i]->mnLeft; + aRect.Right() = rItems[i]->mnLeft+rItems[i]->mnOldWidth-1; + aRect.Top() = rItems[i]->mnOldSplitPos; + aRect.Bottom() = aRect.Top() + rItems[i]->mnOldSplitSize; } else { - aRect.Top() = pItems[i]->mnTop; - aRect.Bottom() = pItems[i]->mnTop+pItems[i]->mnOldHeight-1; - aRect.Left() = pItems[i]->mnOldSplitPos; - aRect.Right() = aRect.Left() + pItems[i]->mnOldSplitSize; + aRect.Top() = rItems[i]->mnTop; + aRect.Bottom() = rItems[i]->mnTop+rItems[i]->mnOldHeight-1; + aRect.Left() = rItems[i]->mnOldSplitPos; + aRect.Right() = aRect.Left() + rItems[i]->mnOldSplitSize; } pWindow->Invalidate( aRect ); // invalidate new rectangle if ( bRows ) { - aRect.Left() = pItems[i]->mnLeft; - aRect.Right() = pItems[i]->mnLeft+pItems[i]->mnWidth-1; - aRect.Top() = pItems[i]->mnSplitPos; - aRect.Bottom() = aRect.Top() + pItems[i]->mnSplitSize; + aRect.Left() = rItems[i]->mnLeft; + aRect.Right() = rItems[i]->mnLeft+rItems[i]->mnWidth-1; + aRect.Top() = rItems[i]->mnSplitPos; + aRect.Bottom() = aRect.Top() + rItems[i]->mnSplitSize; } else { - aRect.Top() = pItems[i]->mnTop; - aRect.Bottom() = pItems[i]->mnTop+pItems[i]->mnHeight-1; - aRect.Left() = pItems[i]->mnSplitPos; - aRect.Right() = aRect.Left() + pItems[i]->mnSplitSize; + aRect.Top() = rItems[i]->mnTop; + aRect.Bottom() = rItems[i]->mnTop+rItems[i]->mnHeight-1; + aRect.Left() = rItems[i]->mnSplitPos; + aRect.Right() = aRect.Left() + rItems[i]->mnSplitSize; } pWindow->Invalidate( aRect ); // invalidate complete set, as these areas // are not cluttered by windows - if ( pItems[i]->mpSet && pItems[i]->mpSet->mpItems.empty() ) + if ( rItems[i]->mpSet && rItems[i]->mpSet->mpItems.empty() ) { - aRect.Left() = pItems[i]->mnLeft; - aRect.Top() = pItems[i]->mnTop; - aRect.Right() = pItems[i]->mnLeft+pItems[i]->mnWidth-1; - aRect.Bottom() = pItems[i]->mnTop+pItems[i]->mnHeight-1; + aRect.Left() = rItems[i]->mnLeft; + aRect.Top() = rItems[i]->mnTop; + aRect.Right() = rItems[i]->mnLeft+rItems[i]->mnWidth-1; + aRect.Bottom() = rItems[i]->mnTop+rItems[i]->mnHeight-1; pWindow->Invalidate( aRect ); } } @@ -892,36 +892,36 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, bool b // position windows for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mpSet ) + if ( rItems[i]->mpSet ) { bool bTempHide = bHide; - if ( !pItems[i]->mnWidth || !pItems[i]->mnHeight ) + if ( !rItems[i]->mnWidth || !rItems[i]->mnHeight ) bTempHide = true; - ImplCalcSet2( pWindow, pItems[i]->mpSet, bTempHide, - !(pItems[i]->mnBits & SplitWindowItemFlags::ColSet) ); + ImplCalcSet2( pWindow, rItems[i]->mpSet, bTempHide, + !(rItems[i]->mnBits & SplitWindowItemFlags::ColSet) ); } else { - if ( pItems[i]->mnWidth && pItems[i]->mnHeight && !bHide ) + if ( rItems[i]->mnWidth && rItems[i]->mnHeight && !bHide ) { - Point aPos( pItems[i]->mnLeft, pItems[i]->mnTop ); - Size aSize( pItems[i]->mnWidth, pItems[i]->mnHeight ); - pItems[i]->mpWindow->SetPosSizePixel( aPos, aSize ); + Point aPos( rItems[i]->mnLeft, rItems[i]->mnTop ); + Size aSize( rItems[i]->mnWidth, rItems[i]->mnHeight ); + rItems[i]->mpWindow->SetPosSizePixel( aPos, aSize ); } else - pItems[i]->mpWindow->Hide(); + rItems[i]->mpWindow->Hide(); } } // show windows and reset flag for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mpWindow && pItems[i]->mnWidth && pItems[i]->mnHeight && !bHide ) - pItems[i]->mpWindow->Show(); + if ( rItems[i]->mpWindow && rItems[i]->mnWidth && rItems[i]->mnHeight && !bHide ) + rItems[i]->mpWindow->Show(); } } -static void ImplCalcLogSize( ImplSplitItems pItems, size_t nItems ) +static void ImplCalcLogSize( ImplSplitItems rItems, size_t nItems ) { // update original sizes size_t i; @@ -930,30 +930,30 @@ static void ImplCalcLogSize( ImplSplitItems pItems, size_t nItems ) for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mnBits & SplitWindowItemFlags::RelativeSize ) - nRelSize += pItems[i]->mnPixSize; - else if ( pItems[i]->mnBits & SplitWindowItemFlags::PercentSize ) - nPerSize += pItems[i]->mnPixSize; + if ( rItems[i]->mnBits & SplitWindowItemFlags::RelativeSize ) + nRelSize += rItems[i]->mnPixSize; + else if ( rItems[i]->mnBits & SplitWindowItemFlags::PercentSize ) + nPerSize += rItems[i]->mnPixSize; } nPerSize += nRelSize; for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mnBits & SplitWindowItemFlags::RelativeSize ) + if ( rItems[i]->mnBits & SplitWindowItemFlags::RelativeSize ) { if ( nRelSize ) - pItems[i]->mnSize = (pItems[i]->mnPixSize+(nRelSize/2))/nRelSize; + rItems[i]->mnSize = (rItems[i]->mnPixSize+(nRelSize/2))/nRelSize; else - pItems[i]->mnSize = 1; + rItems[i]->mnSize = 1; } - else if ( pItems[i]->mnBits & SplitWindowItemFlags::PercentSize ) + else if ( rItems[i]->mnBits & SplitWindowItemFlags::PercentSize ) { if ( nPerSize ) - pItems[i]->mnSize = (pItems[i]->mnPixSize*100)/nPerSize; + rItems[i]->mnSize = (rItems[i]->mnPixSize*100)/nPerSize; else - pItems[i]->mnSize = 1; + rItems[i]->mnSize = 1; } else - pItems[i]->mnSize = pItems[i]->mnPixSize; + rItems[i]->mnSize = rItems[i]->mnPixSize; } } @@ -990,7 +990,7 @@ void SplitWindow::ImplDrawBack(vcl::RenderContext& rRenderContext, ImplSplitSet* { sal_uInt16 i; size_t nItems = pSet->mpItems.size(); - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; // also draw background for mainset if (pSet->mnId == 0) @@ -1007,13 +1007,13 @@ void SplitWindow::ImplDrawBack(vcl::RenderContext& rRenderContext, ImplSplitSet* for (i = 0; i < nItems; i++) { - pSet = pItems[i]->mpSet; + pSet = rItems[i]->mpSet; if (pSet) { if (pSet->mpBitmap || pSet->mpWallpaper) { - Point aPoint(pItems[i]->mnLeft, pItems[i]->mnTop); - Size aSize(pItems[i]->mnWidth, pItems[i]->mnHeight); + Point aPoint(rItems[i]->mnLeft, rItems[i]->mnTop); + Size aSize(rItems[i]->mnWidth, rItems[i]->mnHeight); Rectangle aRect(aPoint, aSize); ImplDrawBack(rRenderContext, aRect, pSet->mpWallpaper, pSet->mpBitmap); } @@ -1022,8 +1022,8 @@ void SplitWindow::ImplDrawBack(vcl::RenderContext& rRenderContext, ImplSplitSet* for (i = 0; i < nItems; i++) { - if (pItems[i]->mpSet) - ImplDrawBack(rRenderContext, pItems[i]->mpSet); + if (rItems[i]->mpSet) + ImplDrawBack(rRenderContext, rItems[i]->mpSet); } } @@ -1037,21 +1037,21 @@ static void ImplDrawSplit(vcl::RenderContext& rRenderContext, ImplSplitSet* pSet long nPos; long nTop; long nBottom; - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); for (i = 0; i < nItems-1; i++) { - if (pItems[i]->mnSplitSize) + if (rItems[i]->mnSplitSize) { - nPos = pItems[i]->mnSplitPos; + nPos = rItems[i]->mnSplitPos; - long nItemSplitSize = pItems[i]->mnSplitSize; + long nItemSplitSize = rItems[i]->mnSplitSize; long nSplitSize = pSet->mnSplitSize; if (bRows) { - nTop = pItems[i]->mnLeft; - nBottom = pItems[i]->mnLeft+pItems[i]->mnWidth-1; + nTop = rItems[i]->mnLeft; + nBottom = rItems[i]->mnLeft+rItems[i]->mnWidth-1; if (bFlat) nPos--; @@ -1082,8 +1082,8 @@ static void ImplDrawSplit(vcl::RenderContext& rRenderContext, ImplSplitSet* pSet } else { - nTop = pItems[i]->mnTop; - nBottom = pItems[i]->mnTop+pSet->mpItems[i]->mnHeight-1; + nTop = rItems[i]->mnTop; + nBottom = rItems[i]->mnTop+pSet->mpItems[i]->mnHeight-1; if (bFlat) nPos--; @@ -1116,9 +1116,9 @@ static void ImplDrawSplit(vcl::RenderContext& rRenderContext, ImplSplitSet* pSet for (i = 0; i < nItems; i++) { - if (pItems[i]->mpSet && pItems[i]->mnWidth && pItems[i]->mnHeight) + if (rItems[i]->mpSet && rItems[i]->mnWidth && rItems[i]->mnHeight) { - ImplDrawSplit(rRenderContext, pItems[i]->mpSet, !(pItems[i]->mnBits & SplitWindowItemFlags::ColSet), bFlat); + ImplDrawSplit(rRenderContext, rItems[i]->mpSet, !(rItems[i]->mnBits & SplitWindowItemFlags::ColSet), bFlat); } } } @@ -1138,7 +1138,7 @@ sal_uInt16 SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos, long nPos; long nTop; long nBottom; - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; if ( bRows ) { @@ -1153,24 +1153,24 @@ sal_uInt16 SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos, for ( i = 0; i < nItems-1; i++ ) { - if ( pItems[i]->mnSplitSize ) + if ( rItems[i]->mnSplitSize ) { if ( bRows ) { - nTop = pItems[i]->mnLeft; - nBottom = pItems[i]->mnLeft+pItems[i]->mnWidth-1; + nTop = rItems[i]->mnLeft; + nBottom = rItems[i]->mnLeft+rItems[i]->mnWidth-1; } else { - nTop = pItems[i]->mnTop; - nBottom = pItems[i]->mnTop+pItems[i]->mnHeight-1; + nTop = rItems[i]->mnTop; + nBottom = rItems[i]->mnTop+rItems[i]->mnHeight-1; } - nPos = pItems[i]->mnSplitPos; + nPos = rItems[i]->mnSplitPos; if ( (nMPos1 >= nTop) && (nMPos1 <= nBottom) && - (nMPos2 >= nPos) && (nMPos2 <= nPos+pItems[i]->mnSplitSize) ) + (nMPos2 >= nPos) && (nMPos2 <= nPos+rItems[i]->mnSplitSize) ) { - if ( !pItems[i]->mbFixed && !pItems[i+1]->mbFixed ) + if ( !rItems[i]->mbFixed && !rItems[i+1]->mbFixed ) { rMouseOff = nMPos2-nPos; *ppFoundSet = pSet; @@ -1188,11 +1188,11 @@ sal_uInt16 SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos, for ( i = 0; i < nItems; i++ ) { - if ( pItems[i]->mpSet ) + if ( rItems[i]->mpSet ) { - nSplitTest = ImplTestSplit( pItems[i]->mpSet, rPos, + nSplitTest = ImplTestSplit( rItems[i]->mpSet, rPos, rMouseOff, ppFoundSet, rFoundPos, - !(pItems[i]->mnBits & SplitWindowItemFlags::ColSet) ); + !(rItems[i]->mnBits & SplitWindowItemFlags::ColSet) ); if ( nSplitTest ) return nSplitTest; } @@ -2184,13 +2184,13 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt ) } else { - ImplSplitItems& pItems = mpSplitSet->mpItems; + ImplSplitItems& rItems = mpSplitSet->mpItems; sal_uInt16 nItems = mpSplitSet->mpItems.size(); mpLastSizes = new long[nItems*2]; for ( sal_uInt16 i = 0; i < nItems; i++ ) { - mpLastSizes[i*2] = pItems[i]->mnSize; - mpLastSizes[i*2+1] = pItems[i]->mnPixSize; + mpLastSizes[i*2] = rItems[i]->mnSize; + mpLastSizes[i*2+1] = rItems[i]->mnPixSize; } } mnMStartPos = mnMSplitPos; @@ -2425,12 +2425,12 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) { if ( rTEvt.IsTrackingCanceled() ) { - ImplSplitItems& pItems = mpSplitSet->mpItems; - size_t nItems = pItems.size(); + ImplSplitItems& rItems = mpSplitSet->mpItems; + size_t nItems = rItems.size(); for ( size_t i = 0; i < nItems; i++ ) { - pItems[i]->mnSize = mpLastSizes[i*2]; - pItems[i]->mnPixSize = mpLastSizes[i*2+1]; + rItems[i]->mnSize = mpLastSizes[i*2]; + rItems[i]->mnPixSize = mpLastSizes[i*2+1]; } ImplUpdate(); Split(); @@ -2794,19 +2794,19 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, return; size_t nItems = pSet->mpItems.size(); - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; // When there is an explicit minimum or maximum size then move nNewSize // into that range (when it is not yet already in it.) - nNewSize = ValidateSize(nNewSize, pItems[nPos]); + nNewSize = ValidateSize(nNewSize, rItems[nPos]); if ( mbCalc ) { - pItems[nPos]->mnSize = nNewSize; + rItems[nPos]->mnSize = nNewSize; return; } - long nDelta = nNewSize-pItems[nPos]->mnPixSize; + long nDelta = nNewSize-rItems[nPos]->mnPixSize; if ( !nDelta ) return; @@ -2815,7 +2815,7 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, sal_uInt16 nMax = nItems; for (size_t i = 0; i < nItems; ++i) { - if ( pItems[i]->mbFixed ) + if ( rItems[i]->mbFixed ) { if ( i < nPos ) nMin = i+1; @@ -2879,7 +2879,7 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, { if ( nTempDelta ) { - pItems[n]->mnPixSize++; + rItems[n]->mnPixSize++; nTempDelta++; } n++; @@ -2889,7 +2889,7 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, while ( nTempDelta ); } else - pItems[nPos+1]->mnPixSize -= nDelta; + rItems[nPos+1]->mnPixSize -= nDelta; } if ( bSmall ) @@ -2901,9 +2901,9 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, n = nPos+1; do { - if ( nDelta && pItems[n-1]->mnPixSize ) + if ( nDelta && rItems[n-1]->mnPixSize ) { - pItems[n-1]->mnPixSize--; + rItems[n-1]->mnPixSize--; nDelta++; } @@ -2918,14 +2918,14 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, n = nPos+1; do { - if ( pItems[n-1]->mnPixSize+nDelta < 0 ) + if ( rItems[n-1]->mnPixSize+nDelta < 0 ) { - nDelta += pItems[n-1]->mnPixSize; - pItems[n-1]->mnPixSize = 0; + nDelta += rItems[n-1]->mnPixSize; + rItems[n-1]->mnPixSize = 0; } else { - pItems[n-1]->mnPixSize += nDelta; + rItems[n-1]->mnPixSize += nDelta; break; } n--; @@ -2948,7 +2948,7 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, { if ( nTempDelta ) { - pItems[n-1]->mnPixSize++; + rItems[n-1]->mnPixSize++; nTempDelta--; } n--; @@ -2958,7 +2958,7 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, while ( nTempDelta ); } else - pItems[nPos]->mnPixSize += nDelta; + rItems[nPos]->mnPixSize += nDelta; } if ( bSmall ) @@ -2970,9 +2970,9 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, n = nPos+1; do { - if ( nDelta && pItems[n]->mnPixSize ) + if ( nDelta && rItems[n]->mnPixSize ) { - pItems[n]->mnPixSize--; + rItems[n]->mnPixSize--; nDelta--; } @@ -2987,14 +2987,14 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, n = nPos+1; do { - if ( pItems[n]->mnPixSize-nDelta < 0 ) + if ( rItems[n]->mnPixSize-nDelta < 0 ) { - nDelta -= pItems[n]->mnPixSize; - pItems[n]->mnPixSize = 0; + nDelta -= rItems[n]->mnPixSize; + rItems[n]->mnPixSize = 0; } else { - pItems[n]->mnPixSize -= nDelta; + rItems[n]->mnPixSize -= nDelta; break; } n++; @@ -3005,7 +3005,7 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, } // update original sizes - ImplCalcLogSize( pItems, nItems ); + ImplCalcLogSize( rItems, nItems ); ImplUpdate(); } @@ -3060,35 +3060,35 @@ long SplitWindow::GetItemSize( sal_uInt16 nId, SplitWindowItemFlags nBits ) cons SplitWindowItemFlags nTempBits; sal_uInt16 i; nItems = pSet->mpItems.size(); - ImplSplitItems& pItems = pSet->mpItems; + ImplSplitItems& rItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) { if ( i == nPos ) nTempBits = nBits; else - nTempBits = pItems[i]->mnBits; + nTempBits = rItems[i]->mnBits; if ( nTempBits & SplitWindowItemFlags::RelativeSize ) - nRelSize += pItems[i]->mnPixSize; + nRelSize += rItems[i]->mnPixSize; else if ( nTempBits & SplitWindowItemFlags::PercentSize ) - nPerSize += pItems[i]->mnPixSize; + nPerSize += rItems[i]->mnPixSize; } nPerSize += nRelSize; if ( nBits & SplitWindowItemFlags::RelativeSize ) { if ( nRelSize ) - return (pItems[nPos]->mnPixSize+(nRelSize/2))/nRelSize; + return (rItems[nPos]->mnPixSize+(nRelSize/2))/nRelSize; else return 1; } else if ( nBits & SplitWindowItemFlags::PercentSize ) { if ( nPerSize ) - return (pItems[nPos]->mnPixSize*100)/nPerSize; + return (rItems[nPos]->mnPixSize*100)/nPerSize; else return 1; } else - return pItems[nPos]->mnPixSize; + return rItems[nPos]->mnPixSize; } } else diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index cfb90a0dd060..372e71fcc6d9 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1224,20 +1224,20 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP try { // If we are in comments, then disable CharGrabBag, comment text doesn't support that. - uno::Sequence< beans::PropertyValue > pValues = pPropertyMap->GetPropertyValues(/*bCharGrabBag=*/!m_bIsInComments); - sal_Int32 len = pValues.getLength(); + uno::Sequence< beans::PropertyValue > aValues = pPropertyMap->GetPropertyValues(/*bCharGrabBag=*/!m_bIsInComments); + sal_Int32 len = aValues.getLength(); if (m_bStartTOC || m_bStartIndex || m_bStartBibliography) for( int i =0; i < len; ++i ) { - if (pValues[i].Name == "CharHidden") - pValues[i].Value = uno::makeAny(sal_False); + if (aValues[i].Name == "CharHidden") + aValues[i].Value = uno::makeAny(false); } uno::Reference< text::XTextRange > xTextRange; if (m_aTextAppendStack.top().xInsertPosition.is()) { - xTextRange = xTextAppend->insertTextPortion(rString, pValues, m_aTextAppendStack.top().xInsertPosition); + xTextRange = xTextAppend->insertTextPortion(rString, aValues, m_aTextAppendStack.top().xInsertPosition); m_aTextAppendStack.top().xCursor->gotoRange(xTextRange->getEnd(), true); } else @@ -1246,7 +1246,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP { if(m_bInHeaderFooterImport && !m_bStartTOCHeaderFooter) { - xTextRange = xTextAppend->appendTextPortion(rString, pValues); + xTextRange = xTextAppend->appendTextPortion(rString, aValues); } else { @@ -1258,7 +1258,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP { if (m_bStartIndex || m_bStartBibliography || m_bStartGenericField) xTOCTextCursor->goLeft(1, false); - xTextRange = xTextAppend->insertTextPortion(rString, pValues, xTOCTextCursor); + xTextRange = xTextAppend->insertTextPortion(rString, aValues, xTOCTextCursor); SAL_WARN_IF(!xTextRange.is(), "writerfilter.dmapper", "insertTextPortion failed"); if (!xTextRange.is()) throw uno::Exception("insertTextPortion failed", nullptr); @@ -1268,7 +1268,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP } else { - xTextRange = xTextAppend->appendTextPortion(rString, pValues); + xTextRange = xTextAppend->appendTextPortion(rString, aValues); xTOCTextCursor = xTextAppend->createTextCursor(); xTOCTextCursor->gotoRange(xTextRange->getEnd(), false); } @@ -1276,7 +1276,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP } } else - xTextRange = xTextAppend->appendTextPortion(rString, pValues); + xTextRange = xTextAppend->appendTextPortion(rString, aValues); } CheckRedline( xTextRange ); @@ -1501,7 +1501,7 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::P //switch on header/footer use xPageStyle->setPropertyValue( getPropertyName(ePropIsOn), - uno::makeAny(sal_True)); + uno::makeAny(true)); if (bFirst) { @@ -1510,7 +1510,7 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::P { // This is a first page and has a follow style, then enable the header/footer there as well to be consistent. uno::Reference<beans::XPropertySet> xFollowStyle(GetPageStyles()->getByName(aFollowStyle), uno::UNO_QUERY); - xFollowStyle->setPropertyValue(getPropertyName(ePropIsOn), uno::makeAny(sal_True)); + xFollowStyle->setPropertyValue(getPropertyName(ePropIsOn), uno::makeAny(true)); } } @@ -1925,7 +1925,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape uno::Reference<text::XTextContent> xTextContent(xShape, uno::UNO_QUERY_THROW); uno::Reference<text::XTextRange> xTextRange(xTextAppend->createTextCursorByRange(xTextAppend->getEnd()), uno::UNO_QUERY_THROW); - xTextAppend->insertTextContent(xTextRange, xTextContent, sal_False); + xTextAppend->insertTextContent(xTextRange, xTextContent, false); uno::Reference<beans::XPropertySet> xPropertySet(xTextContent, uno::UNO_QUERY); // we need to re-set this value to xTextContent, then only values are preserved. @@ -2174,7 +2174,7 @@ style::NumberingType:: CHARS_CYRILLIC_LOWER_LETTER_N_SR*/ }; - for( sal_uInt32 nNum = 0; nNum < sizeof(aNumberingPairs)/sizeof( NumberingPairs ); ++nNum) + for( sal_uInt32 nNum = 0; nNum < SAL_N_ELEMENTS(aNumberingPairs); ++nNum) { if( /*sCommand*/sNumber.equalsAscii(aNumberingPairs[nNum].cWordName )) { @@ -2929,7 +2929,7 @@ void DomainMapper_Impl::handleFieldAsk uno::makeAny( sHint )); xFieldProperties->setPropertyValue(getPropertyName(PROP_SUB_TYPE), uno::makeAny(text::SetVariableType::STRING)); // The ASK has no field value to display - xFieldProperties->setPropertyValue(getPropertyName(PROP_IS_VISIBLE), uno::makeAny(sal_False)); + xFieldProperties->setPropertyValue(getPropertyName(PROP_IS_VISIBLE), uno::makeAny(false)); } else { @@ -3105,8 +3105,7 @@ void DomainMapper_Impl::handleAuthor //search for a field mapping OUString sFieldServiceName; sal_uInt16 nMap = 0; - for( ; nMap < sizeof(aDocProperties) / sizeof(DocPropertyMap); - ++nMap ) + for( ; nMap < SAL_N_ELEMENTS(aDocProperties); ++nMap ) { if ((rFirstParam.equalsAscii(aDocProperties[nMap].pDocPropertyName)) && (!xPropertySetInfo->hasPropertyByName(rFirstParam))) { @@ -3447,8 +3446,8 @@ void DomainMapper_Impl::handleToc if(xCrsr.is() && xText.is()) { xCrsr->gotoEnd(false); - xText->insertString(xCrsr, sMarker, sal_False); - xText->insertTextContent(uno::Reference< text::XTextRange >( xCrsr, uno::UNO_QUERY_THROW ), xToInsert, sal_False); + xText->insertString(xCrsr, sMarker, false); + xText->insertTextContent(uno::Reference< text::XTextRange >( xCrsr, uno::UNO_QUERY_THROW ), xToInsert, false); xTOCMarkerCursor = xCrsr; } } @@ -4120,7 +4119,7 @@ void DomainMapper_Impl::CloseFieldCommand() if(xCrsr.is() && xText.is()) { xCrsr->gotoEnd(false); - xText->insertTextContent(uno::Reference< text::XTextRange >( xCrsr, uno::UNO_QUERY_THROW ), xToInsert, sal_False); + xText->insertTextContent(uno::Reference< text::XTextRange >( xCrsr, uno::UNO_QUERY_THROW ), xToInsert, false); } } } @@ -4207,9 +4206,9 @@ void DomainMapper_Impl::CloseFieldCommand() uno::Reference< text::XTextCursor > xCrsr = xTextAppend->createTextCursorByRange(pContext->GetStartRange()); if (xTextContent.is()) { - xTextAppend->insertTextContent(xCrsr,xTextContent, sal_True); + xTextAppend->insertTextContent(xCrsr,xTextContent, true); } - const uno::Reference<uno::XInterface> xContent(xTextContent); + uno::Reference<uno::XInterface> xContent(xTextContent); uno::Reference< text::XFormField> xFormField(xContent, uno::UNO_QUERY); xFormField->setFieldType(aCode); m_bStartGenericField = true; @@ -4471,9 +4470,9 @@ void DomainMapper_Impl::PopFieldContext() } else { - xTOCMarkerCursor->goLeft(1,sal_True); + xTOCMarkerCursor->goLeft(1,true); xTOCMarkerCursor->setString(OUString()); - xTOCMarkerCursor->goLeft(1,sal_True); + xTOCMarkerCursor->goLeft(1,true); xTOCMarkerCursor->setString(OUString()); } } diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 034ccafa9350..00517d857399 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -465,9 +465,9 @@ void GraphicImport::handleWrapTextValue(sal_uInt32 nVal) void GraphicImport::putPropertyToFrameGrabBag( const OUString& sPropertyName, const uno::Any& aPropertyValue ) { - beans::PropertyValue pProperty; - pProperty.Name = sPropertyName; - pProperty.Value = aPropertyValue; + beans::PropertyValue aProperty; + aProperty.Name = sPropertyName; + aProperty.Value = aPropertyValue; if (!m_xShape.is()) return; @@ -493,7 +493,7 @@ void GraphicImport::putPropertyToFrameGrabBag( const OUString& sPropertyName, co uno::Sequence<beans::PropertyValue> aTmp; xSet->getPropertyValue(aGrabBagPropName) >>= aTmp; std::vector<beans::PropertyValue> aGrabBag(comphelper::sequenceToContainer<std::vector<beans::PropertyValue> >(aTmp)); - aGrabBag.push_back(pProperty); + aGrabBag.push_back(aProperty); xSet->setPropertyValue(aGrabBagPropName, uno::makeAny(comphelper::containerToSequence(aGrabBag))); } |