diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-04 14:34:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-11 09:48:10 +0200 |
commit | 49eb02f07a5af44da59008a238e828b4a9532bef (patch) | |
tree | 43c4b4eaacd79fe0bff784a4ef71f4c1080c3912 | |
parent | 5823ecd54b16974ffe8821a5ae061cd0ecc4cf84 (diff) |
new loplugin:unusedvariablemore
collection of heuristics to look for local variables that are never read
from i.e. do not contribute to the surrounding logic
This is an expensive plugin, since it walks up the parent tree,
so it is off by default.
Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06
Reviewed-on: https://gerrit.libreoffice.org/52450
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
62 files changed, 433 insertions, 265 deletions
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx index 2ef3c968ed34..4d248c16dc9d 100644 --- a/basctl/source/basicide/localizationmgr.cxx +++ b/basctl/source/basicide/localizationmgr.cxx @@ -460,9 +460,6 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties // Remove Id for all locales else if( eMode == REMOVE_IDS_FROM_RESOURCE ) { - Sequence< OUString > aNewPropStrings; - aNewPropStrings.realloc( nPropStringCount ); - const Locale* pLocales = aLocaleSeq.getConstArray(); sal_Int32 i; for ( i = 0; i < nPropStringCount; ++i ) diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 73948f12f343..738a52a3cabb 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2454,14 +2454,12 @@ uno::Reference< drawing::XShape > } else { - uno::Sequence< uno::Reference< text::XTextCursor > > aCursorList( xFormattedString.getLength() ); sal_Int32 nN = 0; for( nN=0; nN<xFormattedString.getLength();nN++ ) { xTextCursor->gotoEnd(false); xText->insertString( xTextRange, xFormattedString[nN]->getString(), false ); xTextCursor->gotoEnd(true); - aCursorList[nN] = xText->createTextCursorByRange( uno::Reference< text::XTextRange >(xTextCursor,uno::UNO_QUERY) ); } awt::Size aOldRefSize; bool bHasRefPageSize = diff --git a/compilerplugins/clang/test/unusedvariablemore.cxx b/compilerplugins/clang/test/unusedvariablemore.cxx new file mode 100644 index 000000000000..712bcf403614 --- /dev/null +++ b/compilerplugins/clang/test/unusedvariablemore.cxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 <sal/config.h> +#include <sal/types.h> +#include <map> + +struct SAL_WARN_UNUSED Point +{ +}; +struct SAL_WARN_UNUSED Rectangle +{ + Rectangle(); + Rectangle(int width, int height); + Rectangle& Union(const Rectangle&) { return *this; } + Rectangle& Intersection(const Rectangle&); + Rectangle& operator+=(const Point& rPt); +}; + +void func1() +{ + Rectangle aTmp1; // expected-error {{unused variable 'aTmp1' [loplugin:unusedvariablemore]}} + aTmp1.Union(Rectangle(10, 10)); +} + +void func2() +{ + Rectangle aViewArea( + 10, 10); // expected-error@-1 {{unused variable 'aViewArea' [loplugin:unusedvariablemore]}} + aViewArea += Point(); + aViewArea.Intersection(Rectangle(0, 0)); +} + +//--------------------------------------------------------------------- +// Negative tests +//--------------------------------------------------------------------- + +Rectangle func3(const Rectangle& rRect) +{ + Rectangle aTmpRect(Rectangle(10, 10)); + return aTmpRect.Union(rRect); +} + +void func4() +{ + std::map<int, int> aMimeTypeMap; + aMimeTypeMap[1] = 0; + int aExportMimeType(aMimeTypeMap[0]); + (void)aExportMimeType; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/compilerplugins/clang/unusedvariablemore.cxx b/compilerplugins/clang/unusedvariablemore.cxx new file mode 100644 index 000000000000..6d8cf871e013 --- /dev/null +++ b/compilerplugins/clang/unusedvariablemore.cxx @@ -0,0 +1,347 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * Based on LLVM/Clang. + * + * This file is distributed under the University of Illinois Open Source + * License. See LICENSE.TXT for details. + * + */ + +#include <config_global.h> +#include "plugin.hxx" +#include "compat.hxx" +#include "check.hxx" +#include <unordered_set> +#include <unordered_map> + +namespace loplugin +{ +/* + This is a compile check. The results of this plugin need to be checked by hand, since it is a collection of heuristics. + + Check for unused variable where + (*) we never call methods that return information from the variable. + (*) we never pass the variable to anything else + + Classes which are safe to be warned about need to be marked using + SAL_WARN_UNUSED (see e.g. OUString). For external classes such as std::vector + that cannot be edited there is a manual list. + + This is an expensive plugin, since it walks up the parent tree, + so it is off by default. +*/ + +class UnusedVariableMore : public RecursiveASTVisitor<UnusedVariableMore>, public Plugin +{ +public: + explicit UnusedVariableMore(const InstantiationData& data); + virtual void run() override; + bool VisitVarDecl(VarDecl const*); + bool VisitDeclRefExpr(DeclRefExpr const*); + bool VisitFunctionDecl(FunctionDecl const*); + +private: + bool checkifUnused(Stmt const*, VarDecl const*); + bool isOkForParameter(const QualType&); + + std::unordered_set<VarDecl const*> interestingSet; + // used to dump the last place that said the usage was unused, for debug purposes + std::unordered_map<VarDecl const*, Stmt const*> interestingDebugMap; +}; + +UnusedVariableMore::UnusedVariableMore(const InstantiationData& data) + : Plugin(data) +{ +} + +static bool startswith(const std::string& rStr, const char* pSubStr) +{ + return rStr.compare(0, strlen(pSubStr), pSubStr) == 0; +} + +void UnusedVariableMore::run() +{ + std::string fn(compiler.getSourceManager() + .getFileEntryForID(compiler.getSourceManager().getMainFileID()) + ->getName()); + loplugin::normalizeDotDotInFilePath(fn); + + // ignore QA folders + if (startswith(fn, SRCDIR "/sal/qa/")) + return; + if (startswith(fn, SRCDIR "/i18npool/qa/")) + return; + if (startswith(fn, SRCDIR "/sc/qa/")) + return; + + // vector of shared_ptr used to delay destruction + if (fn == SRCDIR "/cppuhelper/source/servicemanager.cxx") + return; + if (fn == SRCDIR "/i18nlangtag/source/languagetag/languagetag.cxx") + return; + if (fn == SRCDIR "/vcl/workben/outdevgrind.cxx") + return; + // unordered_set of Reference to delay destruction + if (fn == SRCDIR "/stoc/source/servicemanager/servicemanager.cxx") + return; + // TODO "operator >>" fooling me here + if (fn == SRCDIR "/editeng/source/accessibility/AccessibleEditableTextPara.cxx") + return; + // some weird stuff + if (fn == SRCDIR "/sfx2/source/dialog/dinfdlg.cxx") + return; + // std::vector< Reference< XInterface > > keep alive + if (fn == SRCDIR "/dbaccess/source/core/dataaccess/databasedocument.cxx") + return; + // template magic + if (fn == SRCDIR "/sc/source/core/tool/scmatrix.cxx") + return; + // storing local copy of Link<> + if (fn == SRCDIR "/sc/source/ui/miscdlgs/simpref.cxx") + return; + // Using an SwPaM to do stuff + if (fn == SRCDIR "/sw/source/core/crsr/bookmrk.cxx") + return; + // index variable in for loop? + if (fn == SRCDIR "/sw/source/uibase/docvw/edtwin.cxx") + return; + // TODO "operator >>" fooling me here + if (fn == SRCDIR "/sw/source/filter/ww8/ww8par.cxx") + return; + // TODO "operator >>" fooling me here + if (fn == SRCDIR "/sc/source/filter/excel/xistream.cxx") + return; + + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + + for (VarDecl const* varDecl : interestingSet) + { + report(DiagnosticsEngine::Warning, "unused variable %0", varDecl->getLocation()) + << varDecl->getDeclName(); + auto it = interestingDebugMap.find(varDecl); + if (it != interestingDebugMap.end()) + it->second->dump(); + } +} + +bool isWarnUnusedType(QualType type) +{ + if (auto const t = type->getAs<TypedefType>()) + { + if (t->getDecl()->hasAttr<WarnUnusedAttr>()) + { + return true; + } + } + if (auto const t = type->getAs<RecordType>()) + { + if (t->getDecl()->hasAttr<WarnUnusedAttr>()) + { + return true; + } + } + return loplugin::isExtraWarnUnusedType(type); +} + +bool UnusedVariableMore::VisitVarDecl(VarDecl const* var) +{ + if (ignoreLocation(var)) + return true; + if (var->isDefinedOutsideFunctionOrMethod()) + return true; + if (isa<ParmVarDecl>(var)) + return true; + if (!isWarnUnusedType(var->getType())) + return true; + + // some false + + auto dc = loplugin::TypeCheck(var->getType()); + if (dc.Class("ZCodec").GlobalNamespace()) + return true; + if (dc.Class("ScopedVclPtrInstance").GlobalNamespace()) + return true; + if (dc.Class("VclPtrInstance").GlobalNamespace()) + return true; + if (dc.Class("Config").GlobalNamespace()) + return true; + // I think these classes modify global state somehow + if (dc.Class("SvtHistoryOptions").GlobalNamespace()) + return true; + if (dc.Class("SvtSecurityOptions").GlobalNamespace()) + return true; + if (dc.Class("SvtViewOptions").GlobalNamespace()) + return true; + if (dc.Class("SvtUserOptions").GlobalNamespace()) + return true; + if (dc.Class("SvtFontOptions").GlobalNamespace()) + return true; + if (dc.Class("SvtMenuOptions").GlobalNamespace()) + return true; + if (dc.Class("SvtPathOptions").GlobalNamespace()) + return true; + if (dc.Class("SvtPrintWarningOptions").GlobalNamespace()) + return true; + if (dc.Class("SvtSysLocaleOptions").GlobalNamespace()) + return true; + + interestingSet.insert(var); + return true; +} + +bool UnusedVariableMore::VisitDeclRefExpr(DeclRefExpr const* declRefExpr) +{ + if (ignoreLocation(declRefExpr)) + return true; + auto varDecl = dyn_cast<VarDecl>(declRefExpr->getDecl()); + if (!varDecl) + return true; + if (interestingSet.find(varDecl) == interestingSet.end()) + return true; + if (!checkifUnused(declRefExpr, varDecl)) + interestingSet.erase(varDecl); + return true; +} + +// Walk up from a statement that contains a DeclRefExpr, checking if the usage means that the +// related VarDecl is unused. +bool UnusedVariableMore::checkifUnused(Stmt const* stmt, VarDecl const* varDecl) +{ + const Stmt* parent = getParentStmt(stmt); + if (!parent) + { + // check if we're inside a CXXCtorInitializer + auto parentsRange = compiler.getASTContext().getParents(*stmt); + if (parentsRange.begin() != parentsRange.end()) + { + auto parentDecl = parentsRange.begin()->get<Decl>(); + if (parentDecl && (isa<CXXConstructorDecl>(parentDecl) || isa<VarDecl>(parentDecl))) + return false; + } + interestingDebugMap[varDecl] = stmt; + return true; + } + + if (isa<ReturnStmt>(parent)) + return false; + if (isa<IfStmt>(parent)) + return false; + if (isa<SwitchStmt>(parent)) + return false; + if (isa<InitListExpr>(parent)) + return false; + if (isa<CXXConstructExpr>(parent)) + return false; + if (isa<BinaryOperator>(parent)) + return false; + if (isa<UnaryOperator>(parent)) + return false; + if (isa<ConditionalOperator>(parent)) + return false; + if (isa<ArraySubscriptExpr>(parent)) + return false; + if (isa<CXXBindTemporaryExpr>(parent)) + return checkifUnused(parent, varDecl); + if (isa<MaterializeTemporaryExpr>(parent)) + return checkifUnused(parent, varDecl); + + if (isa<CompoundStmt>(parent)) + { + interestingDebugMap[varDecl] = parent; + return true; + } + + // check for cast to void + if (auto explicitCastExpr = dyn_cast<ExplicitCastExpr>(parent)) + { + if (loplugin::TypeCheck(explicitCastExpr->getTypeAsWritten()).Void()) + return false; + } + + if (isa<MemberExpr>(parent)) + return checkifUnused(parent, varDecl); + if (isa<ExprWithCleanups>(parent)) + return checkifUnused(parent, varDecl); + if (isa<CastExpr>(parent)) + return checkifUnused(parent, varDecl); + if (isa<ParenExpr>(parent)) + return checkifUnused(parent, varDecl); + + if (auto operatorCallExpr = dyn_cast<CXXOperatorCallExpr>(parent)) + { + const CXXMethodDecl* calleeMethodDecl + = dyn_cast_or_null<CXXMethodDecl>(operatorCallExpr->getDirectCallee()); + if (calleeMethodDecl) + { + if (calleeMethodDecl->getNumParams() == 0) + return checkifUnused(parent, varDecl); + if (operatorCallExpr->getArg(0) == stmt) + return checkifUnused(parent, varDecl); + } + } + if (auto memberCallExpr = dyn_cast<CXXMemberCallExpr>(parent)) + { + const MemberExpr* memberExpr = dyn_cast<MemberExpr>(stmt); + if (memberExpr && memberCallExpr->getImplicitObjectArgument() == memberExpr->getBase()) + { + // if we are calling a method on the varDecl, walk up + if (!checkifUnused(parent, varDecl)) + return false; + // check if we are passing something to the var by non-const ref, in which case it is updating something else for us + const FunctionDecl* calleeFunctionDecl = memberCallExpr->getDirectCallee(); + if (calleeFunctionDecl) + { + if (calleeFunctionDecl->isVariadic()) + return false; + for (unsigned i = 0; i < memberCallExpr->getNumArgs(); ++i) + { + if (i >= calleeFunctionDecl->getNumParams()) // can happen in template code + { + interestingDebugMap[varDecl] = parent; + return true; + } + if (!isOkForParameter(calleeFunctionDecl->getParamDecl(i)->getType())) + return false; + } + } + interestingDebugMap[varDecl] = parent; + return true; + } + } + if (isa<CallExpr>(parent)) + return false; + + interestingDebugMap[varDecl] = parent; + return true; +} + +bool UnusedVariableMore::isOkForParameter(const QualType& qt) +{ + if (qt->isIntegralOrEnumerationType()) + return true; + auto const type = loplugin::TypeCheck(qt); + if (type.Pointer()) + { + return bool(type.Pointer().Const()); + } + else if (type.LvalueReference()) + { + return bool(type.LvalueReference().Const()); + } + return false; +} + +bool UnusedVariableMore::VisitFunctionDecl(FunctionDecl const* functionDecl) +{ + if (ignoreLocation(functionDecl)) + return true; + //functionDecl->dump(); + return true; +} + +static Plugin::Registration<UnusedVariableMore> X("unusedvariablemore", false); + +} // namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 201fa7a9a7ad..076f120c2e16 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -67,7 +67,6 @@ void OConnection::construct(const OUString& url) // Get Scheme nLen = aAddrbookURI.indexOf(':'); OUString aAddrbookScheme; - OUString sAdditionalInfo; if ( nLen == -1 ) { // There isn't any subschema: - but could be just subschema @@ -84,7 +83,6 @@ void OConnection::construct(const OUString& url) else { aAddrbookScheme = aAddrbookURI.copy(0, nLen); - sAdditionalInfo = aAddrbookURI.copy( nLen + 1 ); } SAL_INFO("connectivity.mork", "URI = " << aAddrbookURI ); diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index 59377fe26324..46e66310cadb 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -1077,19 +1077,11 @@ void extractNameValuePairsFromInsert( String2StringMap & map, const OString & la int n = 2; // printf( "1a\n" ); - // extract table name - OString tableName; + // skip table name if( vec[n+1].equalsIgnoreAsciiCase( "." ) ) { - tableName = vec[n]; - tableName += vec[n+1]; - tableName += vec[n+2]; n +=2; } - else - { - tableName = vec[n]; - } std::vector< OString > names; n ++; diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 9378072e4e54..02c4d5c834f0 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -3228,8 +3228,6 @@ void SvxIconSelectorDialog::ImportGraphics( sal_uInt16 ret = 0; sal_Int32 aIndex; OUString aIconName; - uno::Sequence< beans::PropertyValue > aMediaProps( 1 ); - aMediaProps[0].Name = "URL"; if ( rPaths.getLength() == 1 ) { diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 1657140def76..4168e1098e64 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -700,10 +700,9 @@ IMPL_LINK( SvxScriptOrgDialog, ButtonHdl, Button *, pButton, void ) mspNode->getScript( scriptURL ), UNO_QUERY_THROW ); const Sequence< Any > args(0); - Any aRet; Sequence< sal_Int16 > outIndex; Sequence< Any > outArgs( 0 ); - aRet = xScript->invoke( args, outIndex, outArgs ); + xScript->invoke( args, outIndex, outArgs ); } catch ( reflection::InvocationTargetException& ite ) { @@ -983,10 +982,8 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry ) { OUString aNewName = node->getName(); sal_Int32 extnPos = aNewName.lastIndexOf( '.' ); - OUString extn; if(extnPos>0) { - extn = aNewName.copy(extnPos); aNewName = aNewName.copy(0,extnPos); } CuiInputDialog aNewDlg(GetFrameWeld(), InputDialogMode::RENAME); diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 08cd5c21d9f9..528262cacfc6 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -426,7 +426,6 @@ void SvxSaveTabPage::Reset( const SfxItemSet* ) sCommand = sCommand.replaceFirst("%1", sReplace); Reference< XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand); std::vector< OUString > lList; - std::vector<bool> lAlienList; std::vector<bool> lODFList; while(xList->hasMoreElements()) { @@ -434,9 +433,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* ) OUString sFilter = aFilter.getUnpackedValueOrDefault("Name",OUString()); if (!sFilter.isEmpty()) { - SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aFilter.getUnpackedValueOrDefault("Flags",sal_Int32())); lList.push_back(sFilter); - lAlienList.push_back(bool(nFlags & SfxFilterFlags::ALIEN)); lODFList.push_back( isODFFormat( sFilter ) ); } } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 3c6afa8943a5..08bababd9bbf 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -527,13 +527,6 @@ void SvxCharNamePage::UpdatePreview_Impl() SvxFont& rFont = GetPreviewFont(); SvxFont& rCJKFont = GetPreviewCJKFont(); SvxFont& rCTLFont = GetPreviewCTLFont(); - // Size - Size aSize = rFont.GetFontSize(); - aSize.setWidth( 0 ); - Size aCJKSize = rCJKFont.GetFontSize(); - aCJKSize.setWidth( 0 ); - Size aCTLSize = rCTLFont.GetFontSize(); - aCTLSize.setWidth( 0 ); // Font const FontList* pFontList = GetFontList(); diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index 35cc702112a1..c74c71aabbc0 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -403,7 +403,6 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs) // quantity eState = m_pTsbEndless->GetState(); - OUString aStr = m_pNumFldCount->GetText(); if( m_pTsbEndless->IsValueChangedFromSaved() || m_pNumFldCount->IsValueChangedFromSaved() ) { @@ -424,7 +423,6 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs) // delay eState = m_pTsbAuto->GetState(); - aStr = m_pMtrFldDelay->GetText(); if( m_pTsbAuto->IsValueChangedFromSaved() || m_pMtrFldDelay->IsValueChangedFromSaved() ) { @@ -445,7 +443,6 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs) // step size eState = m_pTsbPixel->GetState(); - aStr = m_pMtrFldAmount->GetText(); if( m_pTsbPixel->IsValueChangedFromSaved() || m_pMtrFldAmount->IsValueChangedFromSaved() ) { diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 4cf42de9b18e..b930cba2804e 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -488,7 +488,6 @@ void SvxSlantTabPage::Construct() bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs) { bool bModified = false; - OUString aStr = m_pMtrRadius->GetText(); if( m_pMtrRadius->IsValueChangedFromSaved() ) { @@ -499,8 +498,6 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs) bModified = true; } - aStr = m_pMtrAngle->GetText(); - if( m_pMtrAngle->IsValueChangedFromSaved() ) { sal_Int32 nValue = static_cast<sal_Int32>(m_pMtrAngle->GetValue()); diff --git a/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx b/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx index f1ae31aba077..5cf4ee184ed5 100644 --- a/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx +++ b/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx @@ -50,7 +50,6 @@ OXMLDataSourceInfo::OXMLDataSourceInfo( ODBFilter& rImport sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0; bool bAutoEnabled = false; bool bFoundField = false,bFoundThousand = false, bFoundCharset = false; - std::vector< sal_uInt16 > aTokens; for(sal_Int16 i = 0; i < nLength; ++i) { OUString sLocalName; @@ -61,7 +60,6 @@ OXMLDataSourceInfo::OXMLDataSourceInfo( ODBFilter& rImport aProperty.Name.clear(); sal_uInt16 nToken = rTokenMap.Get( nPrefix, sLocalName ); - aTokens.push_back(nToken); switch( nToken ) { case XML_TOK_ADDITIONAL_COLUMN_STATEMENT: diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 15a86f47f131..31428879bf09 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -468,28 +468,7 @@ NamedDatabaseObject OTableTreeListBox::describeObject( SvTreeListEntry* _pEntry || ( nEntryType == DatabaseObjectContainer::SCHEMA ) ) { - SvTreeListEntry* pParent = GetParent( _pEntry ); - sal_Int32 nParentEntryType = pParent ? reinterpret_cast< sal_IntPtr >( pParent->GetUserData() ) : -1; - - OUStringBuffer buffer; - if ( nEntryType == DatabaseObjectContainer::CATALOG ) - { - if ( nParentEntryType == DatabaseObjectContainer::SCHEMA ) - { - buffer.append( GetEntryText( pParent ) ); - buffer.append( '.' ); - } - buffer.append( GetEntryText( _pEntry ) ); - } - else if ( nEntryType == DatabaseObjectContainer::SCHEMA ) - { - if ( nParentEntryType == DatabaseObjectContainer::CATALOG ) - { - buffer.append( GetEntryText( pParent ) ); - buffer.append( '.' ); - } - buffer.append( GetEntryText( _pEntry ) ); - } + // nothing useful to be done } else { diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index d62403e56da8..6dbfbe6d1285 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -238,17 +238,6 @@ namespace dbaui getFlags( _rSet, bValid, bReadonly ); // if the selection is invalid, disable everything - OUString sName,sConnectURL; - if ( bValid ) - { - // collect some items and some values - const SfxStringItem* pNameItem = _rSet.GetItem<SfxStringItem>(DSID_NAME); - const SfxStringItem* pUrlItem = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL); - assert( pUrlItem ); - assert( pNameItem ); - sName = pNameItem->GetValue(); - sConnectURL = pUrlItem->GetValue(); - } implSetCurrentType( OUString() ); @@ -281,15 +270,12 @@ namespace dbaui getFlags( _rSet, bValid, bReadonly ); // if the selection is invalid, disable everything - OUString sName,sConnectURL; + OUString sConnectURL; if ( bValid ) { // collect some items and some values - const SfxStringItem* pNameItem = _rSet.GetItem<SfxStringItem>(DSID_NAME); const SfxStringItem* pUrlItem = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL); assert( pUrlItem ); - assert( pNameItem ); - sName = pNameItem->GetValue(); sConnectURL = pUrlItem->GetValue(); } diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index 98aa9aba0b1c..46e25920c769 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -408,7 +408,6 @@ namespace drawinglayer } }; - std::vector< processor3d::ZBufferProcessor3D* > aProcessors; const sal_uInt32 nLinesPerThread(aBZPixelRaster.getHeight() / nThreadCount); std::shared_ptr<comphelper::ThreadTaskTag> aTag = comphelper::ThreadPool::createThreadTaskTag(); @@ -425,7 +424,6 @@ namespace drawinglayer aBZPixelRaster, nLinesPerThread * a, a + 1 == nThreadCount ? aBZPixelRaster.getHeight() : nLinesPerThread * (a + 1)); - aProcessors.push_back(pNewZBufferProcessor3D); Executor* pExecutor = new Executor(aTag, pNewZBufferProcessor3D, getChildren3D()); rThreadPool.pushTask(pExecutor); } diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index eafff0378716..4d5161ed46b9 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -560,7 +560,6 @@ namespace emfio sal_uInt16 nLen = 0, nOptions = 0; mpInputStream->ReadUInt16( nLen ).ReadUInt16( nOptions ); - tools::Rectangle aRect; if (nOptions & ETO_CLIPPED) { nNonStringLen += 2 * sizeof(sal_uInt16); @@ -571,9 +570,9 @@ namespace emfio break; } - const Point aPt1( ReadPoint() ); - const Point aPt2( ReadPoint() ); - aRect = tools::Rectangle( aPt1, aPt2 ); + ReadPoint(); + ReadPoint(); + SAL_WARN("vcl.wmf", "clipping unsupported"); } ComplexTextLayoutFlags nTextLayoutMode = ComplexTextLayoutFlags::Default; diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index a79cfecae67c..0f12f0cc834d 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -696,14 +696,11 @@ namespace pcr std::vector< Type > aListeners; impl_getComponentListenerTypes_nothrow( aListeners ); - Property aCurrentProperty; OUString sListenerClassName; // loop through all listeners and all methods, and see which we can present at the UI for ( const Type& rListener : aListeners ) { - aCurrentProperty = Property(); - // the programmatic name of the listener, to be used as "property" name sListenerClassName = rListener.getTypeName(); OSL_ENSURE( !sListenerClassName.isEmpty(), "EventHandler::getSupportedProperties: strange - no listener name ..." ); diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index ab4bc19da298..c4d702e32d70 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -873,7 +873,6 @@ void FormulaDlg_Impl::FillListboxes() { // Switch between the "Pages" FormEditData* pData = m_pHelper->getFormEditData(); - OUString aNewTitle; // 1. Page: select function if ( m_pFuncDesc && m_pFuncDesc->getCategory() ) { @@ -894,8 +893,6 @@ void FormulaDlg_Impl::FillListboxes() m_pHelper->setDispatcherLock( true ); // Activate Modal-Mode - aNewTitle = m_aTitle1; - // HelpId for 1. page is the one from the resource m_pParent->SetHelpId( m_aOldHelp ); } diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx index 133b3751c309..a473036d913b 100644 --- a/framework/source/uielement/complextoolbarcontroller.cxx +++ b/framework/source/uielement/complextoolbarcontroller.cxx @@ -89,7 +89,6 @@ void SAL_CALL ComplexToolbarController::execute( sal_Int16 KeyModifier ) { Reference< XDispatch > xDispatch; Reference< XURLTransformer > xURLTransformer; - OUString aCommandURL; css::util::URL aTargetURL; Sequence<PropertyValue> aArgs; @@ -105,7 +104,6 @@ void SAL_CALL ComplexToolbarController::execute( sal_Int16 KeyModifier ) { xURLTransformer = m_xURLTransformer; xDispatch = getDispatchFromCommand( m_aCommandURL ); - aCommandURL = m_aCommandURL; aTargetURL = getInitializedURL(); aArgs = getExecuteArgs(KeyModifier); } diff --git a/include/test/testinteractionhandler.hxx b/include/test/testinteractionhandler.hxx index 805d72ba0d0b..950127ae185d 100644 --- a/include/test/testinteractionhandler.hxx +++ b/include/test/testinteractionhandler.hxx @@ -102,13 +102,10 @@ public: bool bIsRequestPasswordToModify = false; css::task::PasswordRequestMode mode{}; - OString sUrl; - css::task::DocumentPasswordRequest2 passwordRequest2; if (rRequest >>= passwordRequest2) { bIsRequestPasswordToModify = passwordRequest2.IsRequestPasswordToModify; - sUrl = passwordRequest2.Name.toUtf8(); mode = passwordRequest2.Mode; bPasswordRequestFound = true; } @@ -116,7 +113,6 @@ public: if (rRequest >>= passwordMSRequest2) { bIsRequestPasswordToModify = passwordMSRequest2.IsRequestPasswordToModify; - sUrl = passwordMSRequest2.Name.toUtf8(); mode = passwordMSRequest2.Mode; bPasswordRequestFound = true; } diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index c55a19eb02c0..a29a0f21ec33 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -115,7 +115,7 @@ private: SAL_DLLPRIVATE void ImplInsertText( const OUString& rStr, const Selection* pNewSelection = nullptr, bool bIsUserInput = false ); SAL_DLLPRIVATE static OUString ImplGetValidString( const OUString& rString ); SAL_DLLPRIVATE void ImplClearBackground(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRectangle, long nXStart, long nXEnd); - SAL_DLLPRIVATE void ImplPaintBorder(vcl::RenderContext const & rRenderContext, long nXStart, long nXEnd); + SAL_DLLPRIVATE void ImplPaintBorder(vcl::RenderContext const & rRenderContext); SAL_DLLPRIVATE void ImplShowCursor( bool bOnlyIfVisible = true ); SAL_DLLPRIVATE void ImplAlign(); SAL_DLLPRIVATE void ImplAlignAndPaint(); diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index 777133212082..17ca11608481 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -275,11 +275,9 @@ javaFrameworkError jfw_startVM( index ++; } //add all options of the arOptions argument - std::vector<OString> convertedOptions; for (auto const & ii: arOptions) { OString conv = OUStringToOString(ii, osl_getThreadTextEncoding()); - convertedOptions.push_back(conv); arOpt[index].optionString = const_cast<char *>(conv.getStr()); arOpt[index].extraInfo = nullptr; index++; diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx index 2c819b346ff0..abc346f9e4e9 100644 --- a/package/source/manifest/ManifestExport.cxx +++ b/package/source/manifest/ManifestExport.cxx @@ -98,7 +98,6 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con const OUString sWhiteSpace ( " " ); const OUString sSHA256_URL_ODF12 ( SHA256_URL_ODF12 ); - const OUString sSHA256_URL ( SHA256_URL ); const OUString sSHA1_Name ( SHA1_NAME ); const OUString sSHA1_1k_Name ( SHA1_1K_NAME ); @@ -498,8 +497,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con *pStartKeyAlg >>= nStartKeyAlgID; if ( nStartKeyAlgID == xml::crypto::DigestID::SHA256 ) { - sStartKeyAlg = sSHA256_URL_ODF12; // TODO use sSHA256_URL - (void) sSHA256_URL; + sStartKeyAlg = sSHA256_URL_ODF12; // TODO use SHA256_URL aBuffer.append( sal_Int32(32) ); sStartKeySize = aBuffer.makeStringAndClear(); } diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 82de0192902e..7226f9a1e5ab 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1302,7 +1302,6 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS // export sub streams for package, else full stream into a file bool bErr = false; - OUString sErrFile; uno::Reference< beans::XPropertySet> xProp(_xStorageToSaveTo,uno::UNO_QUERY); if ( xProp.is() ) @@ -1388,7 +1387,6 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS aDelegatorArguments, aProps, _xStorageToSaveTo ) ) { bErr = true; - sErrFile = "content.xml"; } } diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 5a4f36fe3d70..226d43e06a1e 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -1076,8 +1076,6 @@ bool ScTable::SearchRangeForAllEmptyCells( // TODO: I'm using a string cell with empty content to // trigger deletion of cell instance on undo. Maybe I // should create a new cell type for this? - ScSetStringParam aParam; - aParam.setTextInput(); pUndoDoc->SetString(ScAddress(nCol, i, nTab), EMPTY_OUSTRING); } } @@ -1113,8 +1111,6 @@ bool ScTable::SearchRangeForAllEmptyCells( // TODO: I'm using a string cell with empty content to // trigger deletion of cell instance on undo. Maybe I // should create a new cell type for this? - ScSetStringParam aParam; - aParam.setTextInput(); pUndoDoc->SetString(ScAddress(nCol, nRow, nTab), EMPTY_OUSTRING); } } diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 51a2a422abfc..41f0ead79097 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -5897,8 +5897,6 @@ void ScInterpreter::IterateParametersIfs( double(*ResultFunc)( const sc::ParamIf if (rItem.meType == ScQueryEntry::ByString) rParam.eSearchType = DetectSearchType(rItem.maString.getString(), pDok); } - ScAddress aAdr; - aAdr.SetTab( nTab1 ); rParam.nCol1 = nCol1; rParam.nCol2 = nCol2; rEntry.nField = nCol1; diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 630b27cebce8..64529b39c9d7 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -1028,8 +1028,6 @@ void ScHTMLLayoutParser::TableDataOff( const HtmlImportInfo* pInfo ) void ScHTMLLayoutParser::TableOn( HtmlImportInfo* pInfo ) { - OUString aTabName; - if ( ++nTableLevel > 1 ) { // Table in Table sal_uInt16 nTmpColOffset = nColOffset; // Will be changed in Colonize() @@ -1061,9 +1059,6 @@ void ScHTMLLayoutParser::TableOn( HtmlImportInfo* pInfo ) case HtmlOptionId::BORDER: // Border is: ((pOption->GetString().Len() == 0) || (pOption->GetNumber() != 0)); break; - case HtmlOptionId::ID: - aTabName = rOption.GetString(); - break; default: break; } } @@ -1118,9 +1113,6 @@ void ScHTMLLayoutParser::TableOn( HtmlImportInfo* pInfo ) case HtmlOptionId::BORDER: //BorderOn is: ((pOption->GetString().Len() == 0) || (pOption->GetNumber() != 0)); break; - case HtmlOptionId::ID: - aTabName = rOption.GetString(); - break; default: break; } } diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 906dd77837c1..296816f5e253 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -581,7 +581,6 @@ void ScTabPageSortOptions::Init() { ScDBCollection* pDBColl = pDoc->GetDBCollection(); const SCTAB nCurTab = pViewData->GetTabNo(); - OUString theDbName = STR_DB_LOCAL_NONAME; const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); m_pLbOutPos->Clear(); @@ -604,12 +603,6 @@ void ScTabPageSortOptions::Init() // Check whether the field that is passed on is a database field: - ScAddress aScAddress( aSortData.nCol1, aSortData.nRow1, nCurTab ); - OUString theArea = - ScRange( aScAddress, - ScAddress( aSortData.nCol2, aSortData.nRow2, nCurTab ) - ).Format(ScRefFlags::RANGE_ABS, pDoc, eConv); - if ( pDBColl ) { ScDBData* pDBData @@ -618,13 +611,10 @@ void ScTabPageSortOptions::Init() aSortData.nCol2, aSortData.nRow2 ); if ( pDBData ) { - theDbName = pDBData->GetName(); m_pBtnHeader->Check( pDBData->HasHeader() ); } } - theArea += " (" + theDbName + ")"; - m_pBtnHeader->SetText( aStrColLabel ); } diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 0c8fd4f7ff10..5efaa3f11085 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -2035,8 +2035,6 @@ void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet double fVal; if (rAny >>= aStr) { - ScSetStringParam aParam; - aParam.setTextInput(); pInsDoc->SetString(ScAddress(nCol,nRow,nNewTab), aStr); } else if (rAny >>= fVal) diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 364ab9c654ef..b85ef75f5417 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -1030,7 +1030,6 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) } SvNumFormatType nType = GetCurrentNumberFormatType(); - SfxItemSet aSet( GetPool(), {{nSlot, nSlot}} ); switch ( nSlot ) { case SID_NUMBER_TWODEC: @@ -1051,7 +1050,6 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) pTabViewShell->SetNumberFormat( SvNumFormatType::NUMBER ); else pTabViewShell->SetNumberFormat( SvNumFormatType::SCIENTIFIC ); - aSet.Put( SfxBoolItem(nSlot, !(nType & SvNumFormatType::SCIENTIFIC)) ); rBindings.Invalidate( nSlot ); rReq.Done(); break; @@ -1060,7 +1058,6 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) pTabViewShell->SetNumberFormat( SvNumFormatType::NUMBER ); else pTabViewShell->SetNumberFormat( SvNumFormatType::DATE ); - aSet.Put( SfxBoolItem(nSlot, !(nType & SvNumFormatType::DATE)) ); rBindings.Invalidate( nSlot ); rReq.Done(); break; @@ -1069,7 +1066,6 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) pTabViewShell->SetNumberFormat( SvNumFormatType::NUMBER ); else pTabViewShell->SetNumberFormat( SvNumFormatType::TIME ); - aSet.Put( SfxBoolItem(nSlot, !(nType & SvNumFormatType::TIME)) ); rBindings.Invalidate( nSlot ); rReq.Done(); break; @@ -1117,7 +1113,6 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) pTabViewShell->SetNumberFormat( SvNumFormatType::NUMBER ); else pTabViewShell->SetNumberFormat( SvNumFormatType::PERCENT ); - aSet.Put( SfxBoolItem(nSlot, !(nType & SvNumFormatType::PERCENT)) ); rBindings.Invalidate( nSlot ); rReq.Done(); break; @@ -1161,7 +1156,6 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) nLeadZeroes); pTabViewShell->SetNumFmtByStr(aCode); - aSet.Put(SfxBoolItem(nSlot, bThousand)); rBindings.Invalidate(nSlot); rReq.Done(); } diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index f605b647a968..72109415af6d 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -543,9 +543,6 @@ void SdDrawDocument::CreateDefaultCellStyles() Color aNullCol(COL_BLACK); - XGradient aNullGrad(aNullCol,COL_WHITE); - aNullGrad.SetStartIntens( 100 ); - aNullGrad.SetEndIntens( 100 ); XHatch aNullHatch(aNullCol); rISet.Put(XFillStyleItem(drawing::FillStyle_SOLID)); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index eed4fa28256c..472814b48f9a 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1856,15 +1856,12 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN nLower = GetLowerBorder(); } - Point aBackgroundPos(nLeft, nUpper); Size aBackgroundSize(aNewPageSize); - ::tools::Rectangle aBorderRect (aBackgroundPos, aBackgroundSize); if (mbScaleObjects) { aBackgroundSize.AdjustWidth( -(nLeft + nRight) ); aBackgroundSize.AdjustHeight( -(nUpper + nLower) ); - aBorderRect.SetSize(aBackgroundSize); aNewPageSize = aBackgroundSize; } diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index 1c69894cf011..f0a5a89209ec 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -111,13 +111,6 @@ void SdDocPreviewWin::CalcSizeAndPos( Size& rSize, Point& rPoint ) void SdDocPreviewWin::ImpPaint( OutputDevice* pVDev ) { - Point aPoint; - Size aSize = pVDev->GetOutputSize(); - Point bPoint(aSize.Width()-2*FRAME, aSize.Height()-2*FRAME ); - CalcSizeAndPos( aSize, aPoint ); - bPoint -= aPoint; - aPoint += Point( FRAME, FRAME ); - svtools::ColorConfig aColorConfig; pVDev->SetLineColor(); diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index 8da3406fb7f5..54fa8b8dc2f5 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -105,9 +105,6 @@ void DrawViewShell::ArrangeGUIElements() int nScrollBarSize = GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize(); maScrBarWH = Size (nScrollBarSize, nScrollBarSize); - Point aHPos = maViewPos; - aHPos.AdjustY(maViewSize.Height() ); - ViewShell::ArrangeGUIElements (); maTabControl->Hide(); diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx index 7ea54d85cc7c..3413d4349dfa 100644 --- a/sdext/source/presenter/PresenterNotesView.cxx +++ b/sdext/source/presenter/PresenterNotesView.cxx @@ -228,8 +228,6 @@ void PresenterNotesView::SetSlide (const Reference<drawing::XDrawPage>& rxNotesP Reference<container::XIndexAccess> xIndexAccess (rxNotesPage, UNO_QUERY); if (xIndexAccess.is()) { - OUString sText; - // Iterate over all shapes and find the one that holds the text. sal_Int32 nCount (xIndexAccess->getCount()); for (sal_Int32 nIndex=0; nIndex<nCount; ++nIndex) @@ -240,11 +238,6 @@ void PresenterNotesView::SetSlide (const Reference<drawing::XDrawPage>& rxNotesP if (xServiceName.is() && xServiceName->getServiceName() == sNotesShapeName) { - Reference<text::XTextRange> xText (xServiceName, UNO_QUERY); - if (xText.is()) - { - sText += xText->getString(); - } } else { @@ -259,7 +252,6 @@ void PresenterNotesView::SetSlide (const Reference<drawing::XDrawPage>& rxNotesP xIndexAccess->getByIndex(nIndex), UNO_QUERY); if (xText.is()) { - sText += xText->getString(); mpTextView->SetText(Reference<text::XText>(xText, UNO_QUERY)); } } diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index 805eb4053da0..cc1f98358a3b 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -643,7 +643,6 @@ void PresenterSlideSorter::UpdateLayout() mbIsLayoutPending = false; const awt::Rectangle aWindowBox (mxWindow->getPosSize()); - awt::Rectangle aCenterBox (aWindowBox); sal_Int32 nLeftBorderWidth (aWindowBox.X); // Get border width. @@ -661,7 +660,7 @@ void PresenterSlideSorter::UpdateLayout() pPane->mxPane->GetPaneBorderPainter()); if ( ! xBorderPainter.is()) break; - aCenterBox = xBorderPainter->addBorder ( + xBorderPainter->addBorder ( mxViewId->getAnchor()->getResourceURL(), awt::Rectangle(0, 0, aWindowBox.Width, aWindowBox.Height), drawing::framework::BorderType_INNER_BORDER); diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx index 8cdf1c3cd825..cf95c1c568f9 100644 --- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx +++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx @@ -67,12 +67,10 @@ void request( css::uno::Sequence<OUString> const & resources, OUString const & interaction) { - std::vector<OString> resUtf8; std::shared_ptr<GVariantBuilder> builder( g_variant_builder_new(G_VARIANT_TYPE ("as")), GVariantBuilderDeleter()); for (auto & i: resources) { auto s(OUStringToOString(i, RTL_TEXTENCODING_UTF8)); - resUtf8.push_back(s); g_variant_builder_add(builder.get(), "s", s.getStr()); } auto iactUtf8(OUStringToOString(interaction, RTL_TEXTENCODING_UTF8)); diff --git a/solenv/CompilerTest_compilerplugins_clang.mk b/solenv/CompilerTest_compilerplugins_clang.mk index 17866e52781f..9e809e484450 100644 --- a/solenv/CompilerTest_compilerplugins_clang.mk +++ b/solenv/CompilerTest_compilerplugins_clang.mk @@ -55,6 +55,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \ compilerplugins/clang/test/unoany \ compilerplugins/clang/test/unusedindex \ compilerplugins/clang/test/unusedvariablecheck \ + compilerplugins/clang/test/unusedvariablemore \ compilerplugins/clang/test/useuniqueptr \ compilerplugins/clang/test/vclwidgets \ )) diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index dbae6cb3c9bc..edbd09ccf29c 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -1735,16 +1735,14 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector, aFont.nTface = 128-aFont.nTface; pS->ReadUChar( aFont.nStyle ); aUserStyles.insert(aFont); - std::vector<sal_Char> aSeq; + // read font name while(true) { sal_Char nChar8(0); pS->ReadChar( nChar8 ); if (nChar8 == 0) break; - aSeq.push_back(nChar8); } - // Do nothing to the font name now in aSeq!? } break; case SIZE: diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx index b6e1d23f2a24..79db5ebedc38 100644 --- a/svgio/source/svgreader/svgtools.cxx +++ b/svgio/source/svgreader/svgtools.cxx @@ -1663,10 +1663,10 @@ namespace svgio const sal_Unicode aSpace(' '); // convert newline to space - OUString aRetval(convert(rCandidate, aNewline, aSpace, false)); + convert(rCandidate, aNewline, aSpace, false); // convert tab to space - aRetval = convert(rCandidate, aTab, aSpace, false); + convert(rCandidate, aTab, aSpace, false); return rCandidate; } diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index 03840282e695..211347a60e53 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -673,7 +673,6 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( std::vector<OUString>& rL sal_uInt16 nMyType; sal_uInt32 nNFEntry; - OUString aStrComment; OUString aNewFormNInfo; long nIndex; @@ -687,7 +686,6 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( std::vector<OUString>& rL if(pNumEntry==nullptr) continue; SvNumFormatType nMyCat=pNumEntry->GetMaskedType(); - aStrComment=pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo= pNumEntry->GetFormatstring(); @@ -709,7 +707,6 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector<OUString>& r sal_uInt16 nMyType; sal_uInt32 nNFEntry; - OUString aStrComment; OUString aNewFormNInfo; for (long nIndex = NF_DATETIME_START; nIndex <= NF_DATETIME_END; ++nIndex) @@ -720,7 +717,6 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector<OUString>& r if(pNumEntry!=nullptr) { SvNumFormatType nMyCat=pNumEntry->GetMaskedType(); - aStrComment=pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo= pNumEntry->GetFormatstring(); @@ -782,7 +778,6 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<OUString>& rL DBG_ASSERT( pCurFmtTable != nullptr, "unknown NumberFormat" ); sal_uInt32 nNFEntry; - OUString aStrComment; OUString aNewFormNInfo; nCurCurrencyEntryPos=0; @@ -796,7 +791,6 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<OUString>& rL if(pNumEntry==nullptr) continue; SvNumFormatType nMyCat=pNumEntry->GetMaskedType(); - aStrComment=pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo= pNumEntry->GetFormatstring(); @@ -835,7 +829,6 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<OUString>& rL if(!bUserNewCurrency &&(pNumEntry->GetType() & SvNumFormatType::DEFINED)) { SvNumFormatType nMyCat=pNumEntry->GetMaskedType(); - aStrComment=pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo= pNumEntry->GetFormatstring(); @@ -860,7 +853,6 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<OUString>& r DBG_ASSERT( pCurFmtTable != nullptr, "unknown NumberFormat" ); - OUString aStrComment; OUString aNewFormNInfo; const NfCurrencyEntry* pTmpCurrencyEntry; @@ -918,7 +910,6 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<OUString>& r pNumEntry->IsAdditionalBuiltin() ) { SvNumFormatType nMyCat=pNumEntry->GetMaskedType(); - aStrComment = pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo = pNumEntry->GetFormatstring(); @@ -1050,7 +1041,6 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<OUString>& rList, DBG_ASSERT( pCurFmtTable != nullptr, "unknown NumberFormat" ); - OUString aStrComment; OUString aNewFormNInfo; bool bAdditional = (nPrivCat != CAT_USERDEFINED && @@ -1067,7 +1057,6 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<OUString>& rList, (bAdditional && pNumEntry->IsAdditionalBuiltin()) ) { SvNumFormatType nMyCat=pNumEntry->GetMaskedType(); - aStrComment=pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo= pNumEntry->GetFormatstring(); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 29b66b5cdf92..9c65c42447bb 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1939,7 +1939,6 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) const tools::Rectangle& rSnap=GetSnapRect(); const tools::Rectangle& rLogic=GetLogicRect(); Point aRef1(rSnap.Center()); - Point aRef2(aRef1); aRef2.AdjustY( 1 ); const SfxPoolItem *pPoolItem=nullptr; if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,true,&pPoolItem)==SfxItemState::SET) { aRef1.setX(static_cast<const SdrTransformRef1XItem*>(pPoolItem)->GetValue() ); @@ -1947,12 +1946,6 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,true,&pPoolItem)==SfxItemState::SET) { aRef1.setY(static_cast<const SdrTransformRef1YItem*>(pPoolItem)->GetValue() ); } - if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2X,true,&pPoolItem)==SfxItemState::SET) { - aRef2.setX(static_cast<const SdrTransformRef2XItem*>(pPoolItem)->GetValue() ); - } - if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y,true,&pPoolItem)==SfxItemState::SET) { - aRef2.setY(static_cast<const SdrTransformRef2YItem*>(pPoolItem)->GetValue() ); - } tools::Rectangle aNewSnap(rSnap); if (rAttr.GetItemState(SDRATTR_MOVEX,true,&pPoolItem)==SfxItemState::SET) { diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index b50736972d35..75830c864536 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1124,10 +1124,6 @@ void SdrTextObj::impDecomposeStretchTextPrimitive( double fRotate, fShearX; rSdrStretchTextPrimitive.getTextRangeTransform().decompose(aScale, aTranslate, fRotate, fShearX); - // use non-mirrored B2DRange aAnchorTextRange for calculations - basegfx::B2DRange aAnchorTextRange(aTranslate); - aAnchorTextRange.expand(aTranslate + aScale); - // prepare outliner SolarMutexGuard aSolarGuard; SdrOutliner& rOutliner = ImpGetDrawOutliner(); @@ -1174,7 +1170,7 @@ void SdrTextObj::impDecomposeStretchTextPrimitive( const double fScaleY(fabs(aScale.getY()) / aOutlinerScale.getY()); rOutliner.SetGlobalCharStretching(static_cast<sal_Int16>(FRound(fScaleX * 100.0)), static_cast<sal_Int16>(FRound(fScaleY * 100.0))); - // mirroring. We are now in aAnchorTextRange sizes. When mirroring in X and Y, + // When mirroring in X and Y, // move the null point which was top left to bottom right. const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0)); const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0)); diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx index dba0e27a94d7..09fc7b9b2117 100644 --- a/sw/source/core/doc/docbasic.cxx +++ b/sw/source/core/doc/docbasic.cxx @@ -74,7 +74,6 @@ static Sequence<Any> *lcl_docbasic_convertArgs( SbxArray& rArgs ) void SwDoc::ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ) { - ErrCode eErr = ERRCODE_NONE; switch( rMacro.GetScriptType() ) { case STARBASIC: @@ -82,7 +81,7 @@ void SwDoc::ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ) SbxBaseRef aRef; SbxValue* pRetValue = new SbxValue; aRef = pRetValue; - eErr = mpDocShell->CallBasic( rMacro.GetMacName(), + mpDocShell->CallBasic( rMacro.GetMacName(), rMacro.GetLibName(), pArgs, pRet ? pRetValue : nullptr ); @@ -119,7 +118,7 @@ void SwDoc::ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ) SAL_INFO("sw", "SwDoc::ExecMacro URL is " << rMacro.GetMacName() ); - eErr = mpDocShell->CallXScript( + mpDocShell->CallXScript( rMacro.GetMacName(), *pUnoArgs, aRet, aOutArgsIndex, aOutArgs); break; diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index c721330682d2..59c28db7188b 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -68,9 +68,6 @@ boost::optional<OUString> SwUndoInsert::GetTextFromDoc() const SwNodeIndex aNd( pDoc->GetNodes(), nNode); SwContentNode* pCNd = aNd.GetNode().GetContentNode(); - SwPaM aPaM( *pCNd, nContent ); - - aPaM.SetMark(); if( pCNd->IsTextNode() ) { diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 4dc670aab746..ad54ef7383e1 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -1214,7 +1214,6 @@ void makeRedline( SwPaM const & rPaM, if (aRevertProperties.getLength()) { SwDoc *const pDoc = rPaM.GetDoc(); - OUString aUnknownExMsg, aPropertyVetoExMsg; // Build set of attributes we want to fetch std::vector<sal_uInt16> aWhichPairs; @@ -1225,15 +1224,13 @@ void makeRedline( SwPaM const & rPaM, const OUString &rPropertyName = aRevertProperties[i].Name; SfxItemPropertySimpleEntry const* pEntry = rPropSet.getPropertyMap().getByName(rPropertyName); - // Queue up any exceptions until the end ... if (!pEntry) { - aUnknownExMsg += "Unknown property: '" + rPropertyName + "' "; + // unknown property break; } else if (pEntry->nFlags & beans::PropertyAttribute::READONLY) { - aPropertyVetoExMsg += "Property is read-only: '" + rPropertyName + "' "; break; } else diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 436f437b7c8c..030125a8f44b 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2341,10 +2341,6 @@ uno::Any SAL_CALL SwXTextField::getPropertyValue(const OUString& rPropertyName) { sal_Int32 nHiddenStart; sal_Int32 nHiddenEnd; - - SwPosition aPosition( pTextField->GetTextNode() ); - aPosition.nContent = pTextField->GetStart(); - bHidden = SwScriptInfo::GetBoundsOfHiddenRange( pTextField->GetTextNode(), pTextField->GetStart(), nHiddenStart, nHiddenEnd ); diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx index 56ba83a50100..d52b69493844 100644 --- a/sw/source/filter/html/htmlftn.cxx +++ b/sw/source/filter/html/htmlftn.cxx @@ -320,16 +320,14 @@ void SwHTMLWriter::OutFootEndNotes() { m_pFormatFootnote = &pTextFootnote->GetFootnote(); - OUString sFootnoteName, sClass; + OUString sFootnoteName; if( m_pFormatFootnote->IsEndNote() ) { - sClass = OOO_STRING_SVTOOLS_HTML_sdendnote; sFootnoteName = OOO_STRING_SVTOOLS_HTML_sdendnote; sFootnoteName += OUString::number(static_cast<sal_Int32>(++m_nEndNote)); } else { - sClass = OOO_STRING_SVTOOLS_HTML_sdfootnote; sFootnoteName = OOO_STRING_SVTOOLS_HTML_sdfootnote; sFootnoteName += OUString::number(static_cast<sal_Int32>(++m_nFootNote)); } diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 296b68a3b901..aa9ef4557bf0 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -604,7 +604,7 @@ bool SwHTMLParser::InsertEmbed() void SwHTMLParser::NewObject() { OUString aClassID; - OUString aName, aStandBy, aId, aStyle, aClass; + OUString aStandBy, aId, aStyle, aClass; Size aSize( USHRT_MAX, USHRT_MAX ); Size aSpace( 0, 0 ); sal_Int16 eVertOri = text::VertOrientation::TOP; @@ -666,7 +666,6 @@ void SwHTMLParser::NewObject() case HtmlOptionId::USEMAP: break; case HtmlOptionId::NAME: - aName = rOption.GetString(); break; case HtmlOptionId::HSPACE: aSpace.setWidth( static_cast<long>(rOption.GetNumber()) ); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 63c6c8c53ea5..87874f9a345d 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -4852,7 +4852,6 @@ void SwHTMLParser::NewCharFormat( HtmlTokenId nToken ) void SwHTMLParser::InsertSpacer() { // and if applicable change it via the options - OUString aId; sal_Int16 eVertOri = text::VertOrientation::TOP; sal_Int16 eHoriOri = text::HoriOrientation::NONE; Size aSize( 0, 0); @@ -4867,9 +4866,6 @@ void SwHTMLParser::InsertSpacer() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HtmlOptionId::ID: - aId = rOption.GetString(); - break; case HtmlOptionId::TYPE: rOption.GetEnum( nType, aHTMLSpacerTypeTable ); break; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index f47be7dcfcda..5c27518b87b6 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -1937,8 +1937,6 @@ eF_ResT SwWW8ImplReader::Read_F_Symbol( WW8FieldDesc*, OUString& rStr ) // "EMBED" eF_ResT SwWW8ImplReader::Read_F_Embedd( WW8FieldDesc*, OUString& rStr ) { - OUString sHost; - WW8ReadFieldParams aReadParam( rStr ); for (;;) { @@ -1948,7 +1946,7 @@ eF_ResT SwWW8ImplReader::Read_F_Embedd( WW8FieldDesc*, OUString& rStr ) switch( nRet ) { case -2: - sHost = aReadParam.GetResult(); + // sHost break; case 's': diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index b6ca8c3848a7..989fe07af328 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -610,7 +610,6 @@ SvXMLImportContextRef SwXMLTableCellContext_Impl::CreateChildContext( { SvXMLImportContext *pContext = nullptr; - OUString sXmlId; bool bSubTable = false; if( XML_NAMESPACE_TABLE == nPrefix && IsXMLToken( rLocalName, XML_TABLE ) ) @@ -630,11 +629,6 @@ SvXMLImportContextRef SwXMLTableCellContext_Impl::CreateChildContext( { bSubTable = true; } - else if ( (XML_NAMESPACE_XML == nPrefix2) && - IsXMLToken( aLocalName, XML_ID ) ) - { - sXmlId = xAttrList->getValueByIndex( i ); - } //FIXME: RDFa } } diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index e8d6de529462..ba3291f465c5 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -1133,7 +1133,6 @@ void SwTableShell::Execute(SfxRequest &rReq) } // Now the slots which are working directly on the TableFormat. - SwFrameFormat *pFormat = rSh.GetTableFormat(); switch ( nSlot ) { case SID_ATTR_ULSPACE: @@ -1153,9 +1152,6 @@ void SwTableShell::Execute(SfxRequest &rReq) SvxLRSpaceItem aLRSpace( *static_cast<const SvxLRSpaceItem*>(pItem) ); aLRSpace.SetWhich( RES_LR_SPACE ); aSet.Put( aLRSpace ); - SwFormatHoriOrient aHori( pFormat->GetHoriOrient() ); - aHori.SetHoriOrient( text::HoriOrientation::NONE ); - aSet.Put( aLRSpace ); rSh.SetTableAttr( aSet ); } break; diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 843e844b4462..3113b3c1f5f1 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -1786,7 +1786,6 @@ uno::Sequence< uno::Any > Content::setPropertyValues( // aEvent.NewValue = std::vector< ProppatchValue > aProppatchValues; - std::vector< sal_Int32 > aProppatchPropsPositions; uno::Reference< ucb::XPersistentPropertySet > xAdditionalPropSet; bool bTriedToGetAdditionalPropSet = false; @@ -1961,10 +1960,6 @@ uno::Sequence< uno::Any > Content::setPropertyValues( // Property value will be set on server. ProppatchValue aValue( PROPSET, rName, rValue.Value ); aProppatchValues.push_back( aValue ); - - // remember position within sequence of values (for - // error handling). - aProppatchPropsPositions.push_back( n ); } else { diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx index a4c49a4a3373..318b021ab90b 100644 --- a/unotools/source/config/viewoptions.cxx +++ b/unotools/source/config/viewoptions.cxx @@ -55,13 +55,8 @@ } #endif // DEBUG_VIEWOPTIONS -#define SVTVIEWOPTIONS_LOG_UNEXPECTED_EXCEPTION(SVTVIEWOPTIONS_LOG_UNEXPECTED_EXCEPTION_PARAM_EXCEPTION) \ - { \ - OUStringBuffer sMsg(256); \ - sMsg.append("Unexpected exception caught. Original message was:\n\"" ); \ - sMsg.append (SVTVIEWOPTIONS_LOG_UNEXPECTED_EXCEPTION_PARAM_EXCEPTION.Message); \ - sMsg.append("\"" ); \ - } +#define SVTVIEWOPTIONS_LOG_UNEXPECTED_EXCEPTION(ex) \ + SAL_WARN("unotools", "Unexpected exception caught. Original message was: " << ex.Message); // initialization! diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index 3f7731d99602..868100fe3cc3 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -705,7 +705,6 @@ static bool UCBOpenContentSync( xListener); } - Any aResult; bool bException(false); bool bAborted(false); bool bResultAchieved(false); @@ -810,7 +809,6 @@ static bool UCBOpenContentSync( case Moderator::ResultType::RESULT: { bResultAchieved = true; - aResult = res.result; break; } case Moderator::ResultType::COMMANDABORTED: @@ -909,13 +907,12 @@ static bool UCBOpenContentSync_( if ( xProps.is() ) xProps->addPropertiesChangeListener( Sequence< OUString >(), xListener ); - Any aResult; bool bException = false; bool bAborted = false; try { - aResult = aContent.executeCommand( rArg.Name, rArg.Argument ); + aContent.executeCommand( rArg.Name, rArg.Argument ); } catch (const CommandAbortedException&) { diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 8d3bfa665596..a1671d70bb59 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -532,7 +532,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl else rRenderContext.SetTextFillColor(IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor()); - ImplPaintBorder(rRenderContext, 0, GetOutputSizePixel().Width()); + ImplPaintBorder(rRenderContext); bool bDrawSelection = maSelection.Len() && (HasFocus() || (GetStyle() & WB_NOHIDESELECTION) || mbActivePopup); @@ -1000,16 +1000,12 @@ void Edit::ImplClearBackground(vcl::RenderContext& rRenderContext, const tools:: } } -void Edit::ImplPaintBorder(vcl::RenderContext const & rRenderContext, long nXStart, long nXEnd) +void Edit::ImplPaintBorder(vcl::RenderContext const & rRenderContext) { // this is not needed when double-buffering if (SupportsDoubleBuffering()) return; - tools::Rectangle aRect(Point(), GetOutputSizePixel()); - aRect.SetLeft( nXStart ); - aRect.SetRight( nXEnd ); - if (ImplUseNativeBorder(rRenderContext, GetStyle()) || IsPaintTransparent()) { // draw the inner part by painting the whole control using its border window diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 42479871c8a4..a0a2be3fb4e7 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -1390,7 +1390,6 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize ) if ( i == mpMainSet->mvItems.size() ) { long nDelta = 0; - Point aPos = GetPosPixel(); long nCurSize; if ( mbHorz ) @@ -1410,7 +1409,6 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize ) aSize.AdjustHeight(nDelta ); break; case WindowAlign::Bottom: - aPos.AdjustY( -nDelta ); aSize.AdjustHeight(nDelta ); break; case WindowAlign::Left: @@ -1418,7 +1416,6 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize ) break; case WindowAlign::Right: default: - aPos.AdjustX( -nDelta ); aSize.AdjustWidth(nDelta ); break; } diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index b03847b6c036..0cbabe033df9 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3216,7 +3216,6 @@ void DomainMapper_Impl::handleRubyEQField( const FieldContextPtr& pContext) { const OUString & rCommand(pContext->GetCommand()); sal_Int32 nIndex = 0, nEnd = 0; - OUString aToken ,sFont; RubyInfo aInfo ; nIndex = rCommand.indexOf("\\* jc" ); if (nIndex != -1) @@ -3235,13 +3234,8 @@ void DomainMapper_Impl::handleRubyEQField( const FieldContextPtr& pContext) aInfo.nRubyAlign = aRubyAlignValues[(nJc<SAL_N_ELEMENTS(aRubyAlignValues))?nJc:0]; } - nIndex = rCommand.indexOf("\\* \"Font:" ); - if (nIndex != -1) - { - nIndex += 9; - aToken = rCommand.getToken(0, '"',nIndex); - sFont = aToken; - } + // we don't parse or use the font field in rCommand + nIndex = rCommand.indexOf("\\* hps" ); if (nIndex != -1) { diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index df34513b94a4..4fbf337600d4 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -119,9 +119,6 @@ namespace xmloff { DBG_CHECK_PROPERTY_NO_TYPE(*aProperty); -#if OSL_DEBUG_LEVEL > 0 - const OUString sPropertyName = *aProperty; (void)sPropertyName; -#endif if ( !shouldExportProperty( *aProperty ) ) continue; diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 91699e4ed755..c8c7442b20b8 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -865,8 +865,6 @@ bool ImportContext::importGraphicOrImageProperty( xGraphicStorageHandler.set(xGraphicResolver, uno::UNO_QUERY); if (xGraphicStorageHandler.is()) { - OUString aTmp("vnd.sun.star.Package:"); - aTmp += sURL; try { xGraphic = xGraphicStorageHandler->loadGraphic(sURL); |