compilerplugins/clang/test/unusedfields.cxx | 25 compilerplugins/clang/unusedfields.cxx | 97 ++- cui/source/inc/cuitabarea.hxx | 4 cui/source/inc/numpages.hxx | 1 cui/source/tabpages/numpages.cxx | 274 ++-------- cui/source/tabpages/tparea.cxx | 16 include/svtools/ctrlbox.hxx | 3 sc/source/filter/html/htmlpars.cxx | 24 sc/source/filter/inc/defnamesbuffer.hxx | 3 sc/source/filter/inc/workbooksettings.hxx | 1 sc/source/filter/oox/defnamesbuffer.cxx | 80 -- sc/source/filter/oox/formulaparser.cxx | 18 sc/source/filter/oox/workbooksettings.cxx | 5 sd/source/ui/dlg/RemoteDialogClientBox.cxx | 26 sd/source/ui/dlg/RemoteDialogClientBox.hxx | 3 sd/source/ui/view/viewshel.cxx | 93 +-- svtools/source/control/ctrlbox.cxx | 5 unotools/source/config/eventcfg.cxx | 15 vcl/inc/printdlg.hxx | 1 vcl/source/window/printdlg.cxx | 17 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 21 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx | 2 22 files changed, 223 insertions(+), 511 deletions(-)
New commits: commit 5d86154f49d713dada4aaa541755076cfeefa2c6 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Sep 18 09:57:26 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Sep 18 15:19:04 2018 +0200 loplugin:unusedfields improve search for unused collection fields look for collection-like fields that are never added to, and are therefore effectively unused Change-Id: Id52c5500ea5e3d2436fb5915aebb86278bf2d925 Reviewed-on: https://gerrit.libreoffice.org/60661 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/compilerplugins/clang/test/unusedfields.cxx b/compilerplugins/clang/test/unusedfields.cxx index fe81c88ed205..a6b1ec625ec3 100644 --- a/compilerplugins/clang/test/unusedfields.cxx +++ b/compilerplugins/clang/test/unusedfields.cxx @@ -10,6 +10,7 @@ #include <vector> #include <ostream> #include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/uno/Sequence.hxx> struct Foo // expected-error@-1 {{read m_foo1 [loplugin:unusedfields]}} @@ -172,4 +173,28 @@ struct ReadOnlyAnalysis3 } }; +// Verify the special logic for container fields that only contains mutations that +// add elements. +struct ReadOnlyAnalysis4 +// expected-error@-1 {{read m_readonly [loplugin:unusedfields]}} +// expected-error@-2 {{read m_readwrite [loplugin:unusedfields]}} +// expected-error@-3 {{write m_readwrite [loplugin:unusedfields]}} +// expected-error@-4 {{read m_readonlyCss [loplugin:unusedfields]}} +{ + std::vector<int> m_readonly; + std::vector<int> m_readwrite; + css::uno::Sequence<sal_Int32> m_readonlyCss; + + void func1() + { + int x = m_readonly[0]; + (void)x; + *m_readonly.begin() = 1; + + m_readwrite.push_back(0); + + x = m_readonlyCss.getArray()[0]; + } +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/compilerplugins/clang/unusedfields.cxx b/compilerplugins/clang/unusedfields.cxx index 5ba6ac3c1cd6..bcb2db202cec 100644 --- a/compilerplugins/clang/unusedfields.cxx +++ b/compilerplugins/clang/unusedfields.cxx @@ -159,9 +159,10 @@ public: private: MyFieldInfo niceName(const FieldDecl*); void checkTouchedFromOutside(const FieldDecl* fieldDecl, const Expr* memberExpr); - void checkWriteOnly(const FieldDecl* fieldDecl, const Expr* memberExpr); - void checkReadOnly(const FieldDecl* fieldDecl, const Expr* memberExpr); + void checkIfReadFrom(const FieldDecl* fieldDecl, const Expr* memberExpr); + void checkIfWrittenTo(const FieldDecl* fieldDecl, const Expr* memberExpr); bool isSomeKindOfZero(const Expr* arg); + bool checkForWriteWhenUsingCollectionType(const CXXMethodDecl * calleeMethodDecl); bool IsPassedByNonConst(const FieldDecl* fieldDecl, const Stmt * child, CallerWrapper callExpr, CalleeWrapper calleeFunctionDecl); llvm::Optional<CalleeWrapper> getCallee(CallExpr const *); @@ -453,14 +454,14 @@ bool UnusedFields::VisitMemberExpr( const MemberExpr* memberExpr ) checkTouchedFromOutside(fieldDecl, memberExpr); - checkWriteOnly(fieldDecl, memberExpr); + checkIfReadFrom(fieldDecl, memberExpr); - checkReadOnly(fieldDecl, memberExpr); + checkIfWrittenTo(fieldDecl, memberExpr); return true; } -void UnusedFields::checkWriteOnly(const FieldDecl* fieldDecl, const Expr* memberExpr) +void UnusedFields::checkIfReadFrom(const FieldDecl* fieldDecl, const Expr* memberExpr) { if (insideMoveOrCopyOrCloneDeclParent || insideStreamOutputOperator) { @@ -656,15 +657,10 @@ void UnusedFields::checkWriteOnly(const FieldDecl* fieldDecl, const Expr* member if (bPotentiallyReadFrom) { readFromSet.insert(fieldInfo); - if (fieldInfo.fieldName == "nNextElementNumber") - { - parent->dump(); - memberExpr->dump(); - } } } -void UnusedFields::checkReadOnly(const FieldDecl* fieldDecl, const Expr* memberExpr) +void UnusedFields::checkIfWrittenTo(const FieldDecl* fieldDecl, const Expr* memberExpr) { if (insideMoveOrCopyOrCloneDeclParent) { @@ -749,10 +745,10 @@ void UnusedFields::checkReadOnly(const FieldDecl* fieldDecl, const Expr* memberE { // if calling a non-const operator on the field auto calleeMethodDecl = callee->getAsCXXMethodDecl(); - if (calleeMethodDecl - && operatorCallExpr->getArg(0) == child && !calleeMethodDecl->isConst()) + if (calleeMethodDecl && operatorCallExpr->getArg(0) == child) { - bPotentiallyWrittenTo = true; + if (!calleeMethodDecl->isConst()) + bPotentiallyWrittenTo = checkForWriteWhenUsingCollectionType(calleeMethodDecl); } else if (IsPassedByNonConst(fieldDecl, child, operatorCallExpr, *callee)) { @@ -773,13 +769,13 @@ void UnusedFields::checkReadOnly(const FieldDecl* fieldDecl, const Expr* memberE if (tmp->isBoundMemberFunction(compiler.getASTContext())) { tmp = dyn_cast<MemberExpr>(tmp)->getBase(); } - if (cxxMemberCallExpr->getImplicitObjectArgument() == tmp - && !calleeMethodDecl->isConst()) + if (cxxMemberCallExpr->getImplicitObjectArgument() == tmp) { - bPotentiallyWrittenTo = true; + if (!calleeMethodDecl->isConst()) + bPotentiallyWrittenTo = checkForWriteWhenUsingCollectionType(calleeMethodDecl); break; } - if (IsPassedByNonConst(fieldDecl, child, cxxMemberCallExpr, CalleeWrapper(calleeMethodDecl))) + else if (IsPassedByNonConst(fieldDecl, child, cxxMemberCallExpr, CalleeWrapper(calleeMethodDecl))) bPotentiallyWrittenTo = true; } else @@ -888,6 +884,71 @@ void UnusedFields::checkReadOnly(const FieldDecl* fieldDecl, const Expr* memberE } } +// return true if this not a collection type, or if it is a collection type, and we might be writing to it +bool UnusedFields::checkForWriteWhenUsingCollectionType(const CXXMethodDecl * calleeMethodDecl) +{ + auto const tc = loplugin::TypeCheck(calleeMethodDecl->getParent()); + bool listLike = false, setLike = false, mapLike = false, cssSequence = false; + if (tc.Class("deque").StdNamespace() + || tc.Class("list").StdNamespace() + || tc.Class("queue").StdNamespace() + || tc.Class("vector").StdNamespace()) + { + listLike = true; + } + else if (tc.Class("set").StdNamespace() + || tc.Class("unordered_set").StdNamespace()) + { + setLike = true; + } + else if (tc.Class("map").StdNamespace() + || tc.Class("unordered_map").StdNamespace()) + { + mapLike = true; + } + else if (tc.Class("Sequence").Namespace("uno").Namespace("star").Namespace("sun").Namespace("com").GlobalNamespace()) + { + cssSequence = true; + } + else + return true; + + if (calleeMethodDecl->isOverloadedOperator()) + { + auto oo = calleeMethodDecl->getOverloadedOperator(); + if (oo == OO_Equal) + return true; + // This is operator[]. We only care about things that add elements to the collection. + // if nothing modifies the size of the collection, then nothing useful + // is stored in it. + if (listLike) + return false; + return true; + } + + auto name = calleeMethodDecl->getName(); + if (listLike || setLike || mapLike) + { + if (name == "reserve" || name == "shrink_to_fit" || name == "clear" + || name == "erase" || name == "pop_back" || name == "pop_front" + || name == "front" || name == "back" || name == "data" + || name == "remove" || name == "remove_if" + || name == "unique" || name == "sort" + || name == "begin" || name == "end" + || name == "rbegin" || name == "rend" + || name == "at" || name == "find" || name == "equal_range" + || name == "lower_bound" || name == "upper_bound") + return false; + } + if (cssSequence) + { + if (name == "getArray" || name == "begin" || name == "end") + return false; + } + + return true; +} + bool UnusedFields::IsPassedByNonConst(const FieldDecl* fieldDecl, const Stmt * child, CallerWrapper callExpr, CalleeWrapper calleeFunctionDecl) { diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 544e2e52c62c..c9d1a99bbc52 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -246,10 +246,6 @@ private: protected: Size m_aColorSize; - Size m_aGradientSize; - Size m_aBitmapSize; - Size m_aHatchSize; - Size m_aPatternSize; std::unique_ptr<weld::Container> m_xFillTab; std::unique_ptr<weld::ToggleButton> m_xBtnNone; diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx index 1e2dc214b44b..05cfb40a8e77 100644 --- a/cui/source/inc/numpages.hxx +++ b/cui/source/inc/numpages.hxx @@ -48,7 +48,6 @@ class SvxNumberingPreview : public vcl::Window { const SvxNumRule* pActNum; vcl::Font aStdFont; - bool bPosition; sal_uInt16 nActLevel; protected: diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 8451dd787d63..b65e195f863d 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -2252,7 +2252,6 @@ static long lcl_DrawBullet(VirtualDevice* pVDev, SvxNumberingPreview::SvxNumberingPreview(vcl::Window* pParent, WinBits nWinBits) : Window(pParent, nWinBits) , pActNum(nullptr) - , bPosition(false) , nActLevel(SAL_MAX_UINT16) { SetBorderStyle(WindowBorderStyle::MONO); @@ -2297,232 +2296,97 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool aStdFont.SetFillColor(aBackColor); long nFontHeight = nYStep * 6 / 10; - if (bPosition) - nFontHeight = nYStep * 15 / 10; aStdFont.SetFontSize(Size( 0, nFontHeight )); SvxNodeNum aNum; sal_uInt16 nPreNum = pActNum->GetLevel(0).GetStart(); - if (bPosition) + //#i5153# painting gray or black rectangles as 'normal' numbering text + long nWidth = pVDev->GetTextWidth("Preview"); + long nTextHeight = pVDev->GetTextHeight(); + long nRectHeight = nTextHeight * 2 / 3; + long nTopOffset = nTextHeight - nRectHeight; + Color aBlackColor(COL_BLACK); + if (aBlackColor == aBackColor) + aBlackColor.Invert(); + + for (sal_uInt16 nLevel = 0; nLevel < pActNum->GetLevelCount(); ++nLevel, nYStart = nYStart + nYStep) { - long nLineHeight = nFontHeight * 8 / 7; - sal_uInt8 nStart = 0; - while (!(nActLevel & (1<<nStart))) + const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel); + aNum.GetLevelVal()[ nLevel ] = rFmt.GetStart(); + long nXStart( 0 ); + pVDev->SetFillColor( aBackColor ); + + if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION) { - nStart++; + nXStart = rFmt.GetAbsLSpace() / nWidthRelation; } - if (nStart) - nStart--; - sal_uInt8 nEnd = std::min(sal_uInt8(nStart + 3), sal_uInt8(pActNum->GetLevelCount())); - for (sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel) + else if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT) { - const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel); - aNum.GetLevelVal()[nLevel] = rFmt.GetStart(); - - long nXStart( 0 ); - short nTextOffset( 0 ); - long nNumberXPos( 0 ); - if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION) - { - nXStart = rFmt.GetAbsLSpace() / nWidthRelation; - nTextOffset = rFmt.GetCharTextDistance() / nWidthRelation; - nNumberXPos = nXStart; - long nFirstLineOffset = (-rFmt.GetFirstLineOffset()) / nWidthRelation; - - if (nFirstLineOffset <= nNumberXPos) - nNumberXPos = nNumberXPos - nFirstLineOffset; - else - nNumberXPos = 0; - // in draw this is valid - if (nTextOffset < 0) - nNumberXPos = nNumberXPos + nTextOffset; - } - else if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT) - { - const long nTmpNumberXPos((rFmt.GetIndentAt() + rFmt.GetFirstLineIndent() ) / nWidthRelation); - if (nTmpNumberXPos < 0) - { - nNumberXPos = 0; - } - else - { - nNumberXPos = nTmpNumberXPos; - } - } - - long nBulletWidth = 0; - if (SVX_NUM_BITMAP == (rFmt.GetNumberingType() &(~LINK_TOKEN))) - { - long nYMiddle = nYStart + ( nFontHeight / 2 ); - nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawGraphic(pVDev.get(), rFmt, nNumberXPos, nYMiddle, nWidthRelation) : 0; - } - else if (SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType()) + const long nTmpXStart((rFmt.GetIndentAt() + rFmt.GetFirstLineIndent() ) / nWidthRelation); + if (nTmpXStart < 0) { - nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawBullet(pVDev.get(), rFmt, nNumberXPos, nYStart, aStdFont.GetFontSize()) : 0; + nXStart = 0; } else { - pVDev->SetFont(aStdFont); - aNum.SetLevel(nLevel); - if (pActNum->IsContinuousNumbering()) - aNum.GetLevelVal()[nLevel] = nPreNum; - OUString aText(pActNum->MakeNumString( aNum )); - vcl::Font aSaveFont = pVDev->GetFont(); - vcl::Font aColorFont(aSaveFont); - Color aTmpBulletColor = rFmt.GetBulletColor(); - if (aTmpBulletColor == COL_AUTO) - aTmpBulletColor = aBackColor.IsDark() ? COL_WHITE : COL_BLACK; - else if (aTmpBulletColor == aBackColor) - aTmpBulletColor.Invert(); - aColorFont.SetColor(aTmpBulletColor); - pVDev->SetFont(aColorFont); - pVDev->DrawText(Point(nNumberXPos, nYStart), aText); - pVDev->SetFont(aSaveFont); - nBulletWidth = pVDev->GetTextWidth(aText); - nPreNum++; - } - if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT && - rFmt.GetLabelFollowedBy() == SvxNumberFormat::SPACE ) - { - pVDev->SetFont(aStdFont); - OUString aText(' '); - pVDev->DrawText( Point(nNumberXPos, nYStart), aText ); - nBulletWidth = nBulletWidth + pVDev->GetTextWidth(aText); + nXStart = nTmpXStart; } - - long nTextXPos( 0 ); - if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION) - { - nTextXPos = nXStart; - if (nTextOffset < 0) - nTextXPos = nTextXPos + nTextOffset; - if (nNumberXPos + nBulletWidth + nTextOffset > nTextXPos) - nTextXPos = nNumberXPos + nBulletWidth + nTextOffset; - } - else if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT) - { - switch (rFmt.GetLabelFollowedBy()) - { - case SvxNumberFormat::LISTTAB: - { - nTextXPos = rFmt.GetListtabPos() / nWidthRelation; - if (nTextXPos < nNumberXPos + nBulletWidth) - { - nTextXPos = nNumberXPos + nBulletWidth; - } - } - break; - case SvxNumberFormat::SPACE: - case SvxNumberFormat::NOTHING: - case SvxNumberFormat::NEWLINE: - { - nTextXPos = nNumberXPos + nBulletWidth; - } - break; - } - - nXStart = rFmt.GetIndentAt() / nWidthRelation; - } - - ::tools::Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2)); - pVDev->SetFillColor(aBackColor); - pVDev->DrawRect(aRect1); - - ::tools::Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2 ), Size(aSize.Width() / 2, 2)); - pVDev->DrawRect(aRect2); - nYStart += 2 * nLineHeight; } - } - else - { - //#i5153# painting gray or black rectangles as 'normal' numbering text - long nWidth = pVDev->GetTextWidth("Preview"); - long nTextHeight = pVDev->GetTextHeight(); - long nRectHeight = nTextHeight * 2 / 3; - long nTopOffset = nTextHeight - nRectHeight; - Color aBlackColor(COL_BLACK); - if (aBlackColor == aBackColor) - aBlackColor.Invert(); - - for (sal_uInt16 nLevel = 0; nLevel < pActNum->GetLevelCount(); ++nLevel, nYStart = nYStart + nYStep) + nXStart /= 2; + nXStart += 2; + long nTextOffset = 2 * nXStep; + if (SVX_NUM_BITMAP == (rFmt.GetNumberingType()&(~LINK_TOKEN))) { - const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel); - aNum.GetLevelVal()[ nLevel ] = rFmt.GetStart(); - long nXStart( 0 ); - pVDev->SetFillColor( aBackColor ); - - if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION) - { - nXStart = rFmt.GetAbsLSpace() / nWidthRelation; - } - else if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT) + if (rFmt.IsShowSymbol()) { - const long nTmpXStart((rFmt.GetIndentAt() + rFmt.GetFirstLineIndent() ) / nWidthRelation); - if (nTmpXStart < 0) - { - nXStart = 0; - } - else - { - nXStart = nTmpXStart; - } - } - nXStart /= 2; - nXStart += 2; - long nTextOffset = 2 * nXStep; - if (SVX_NUM_BITMAP == (rFmt.GetNumberingType()&(~LINK_TOKEN))) - { - if (rFmt.IsShowSymbol()) - { - long nYMiddle = nYStart + ( nFontHeight / 2 ); - nTextOffset = lcl_DrawGraphic(pVDev.get(), rFmt, nXStart, nYMiddle, nWidthRelation); - nTextOffset = nTextOffset + nXStep; - } - } - else if (SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType()) - { - if (rFmt.IsShowSymbol()) - { - nTextOffset = lcl_DrawBullet(pVDev.get(), rFmt, nXStart, nYStart, aStdFont.GetFontSize()); - nTextOffset = nTextOffset + nXStep; - } - } - else - { - vcl::Font aColorFont(aStdFont); - Color aTmpBulletColor = rFmt.GetBulletColor(); - if (aTmpBulletColor == COL_AUTO) - aTmpBulletColor = aBackColor.IsDark() ? COL_WHITE : COL_BLACK; - else if (aTmpBulletColor == aBackColor) - aTmpBulletColor.Invert(); - aColorFont.SetColor(aTmpBulletColor); - pVDev->SetFont(aColorFont); - aNum.SetLevel( nLevel ); - if (pActNum->IsContinuousNumbering()) - aNum.GetLevelVal()[nLevel] = nPreNum; - OUString aText(pActNum->MakeNumString(aNum)); - pVDev->DrawText(Point(nXStart, nYStart), aText); - pVDev->SetFont(aStdFont); - nTextOffset = pVDev->GetTextWidth(aText); + long nYMiddle = nYStart + ( nFontHeight / 2 ); + nTextOffset = lcl_DrawGraphic(pVDev.get(), rFmt, nXStart, nYMiddle, nWidthRelation); nTextOffset = nTextOffset + nXStep; - nPreNum++; - } - //#i5153# the selected rectangle(s) should be black - if (0 != (nActLevel & (1<<nLevel))) - { - pVDev->SetFillColor( aBlackColor ); - pVDev->SetLineColor( aBlackColor ); } - else + } + else if (SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType()) + { + if (rFmt.IsShowSymbol()) { - //#i5153# unselected levels are gray - pVDev->SetFillColor( aLineColor ); - pVDev->SetLineColor( aLineColor ); + nTextOffset = lcl_DrawBullet(pVDev.get(), rFmt, nXStart, nYStart, aStdFont.GetFontSize()); + nTextOffset = nTextOffset + nXStep; } - ::tools::Rectangle aRect1(Point(nXStart + nTextOffset, nYStart + nTopOffset), Size(nWidth, nRectHeight)); - pVDev->DrawRect(aRect1); } + else + { + vcl::Font aColorFont(aStdFont); + Color aTmpBulletColor = rFmt.GetBulletColor(); + if (aTmpBulletColor == COL_AUTO) + aTmpBulletColor = aBackColor.IsDark() ? COL_WHITE : COL_BLACK; + else if (aTmpBulletColor == aBackColor) + aTmpBulletColor.Invert(); + aColorFont.SetColor(aTmpBulletColor); + pVDev->SetFont(aColorFont); + aNum.SetLevel( nLevel ); + if (pActNum->IsContinuousNumbering()) + aNum.GetLevelVal()[nLevel] = nPreNum; + OUString aText(pActNum->MakeNumString(aNum)); + pVDev->DrawText(Point(nXStart, nYStart), aText); + pVDev->SetFont(aStdFont); + nTextOffset = pVDev->GetTextWidth(aText); + nTextOffset = nTextOffset + nXStep; + nPreNum++; + } + //#i5153# the selected rectangle(s) should be black + if (0 != (nActLevel & (1<<nLevel))) + { + pVDev->SetFillColor( aBlackColor ); + pVDev->SetLineColor( aBlackColor ); + } + else + { + //#i5153# unselected levels are gray + pVDev->SetFillColor( aLineColor ); + pVDev->SetLineColor( aLineColor ); + } + ::tools::Rectangle aRect1(Point(nXStart + nTextOffset, nYStart + nTopOffset), Size(nWidth, nRectHeight)); + pVDev->DrawRect(aRect1); } } rRenderContext.DrawOutDev(Point(), aSize, Point(), aSize, *pVDev); diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index 68d85d7f0ae1..0daa38f3b1b9 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -127,20 +127,20 @@ SvxAreaTabPage::SvxAreaTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs m_pFillTabPage.disposeAndReset(SvxColorTabPage::Create(aFillTab, &m_rXFSet)); m_aColorSize = m_pFillTabPage->get_container_size(); m_pFillTabPage.disposeAndReset(SvxGradientTabPage::Create(aFillTab, &m_rXFSet)); - m_aGradientSize = m_pFillTabPage->get_container_size(); + Size aGradientSize = m_pFillTabPage->get_container_size(); m_pFillTabPage.disposeAndReset(SvxBitmapTabPage::Create(aFillTab, &m_rXFSet)); - m_aBitmapSize = m_pFillTabPage->get_container_size(); + Size aBitmapSize = m_pFillTabPage->get_container_size(); m_pFillTabPage.disposeAndReset(SvxHatchTabPage::Create(aFillTab, &m_rXFSet)); - m_aHatchSize = m_pFillTabPage->get_container_size(); + Size aHatchSize = m_pFillTabPage->get_container_size(); m_pFillTabPage.disposeAndReset(SvxPatternTabPage::Create(aFillTab, &m_rXFSet)); - m_aPatternSize = m_pFillTabPage->get_container_size(); + Size aPatternSize = m_pFillTabPage->get_container_size(); m_pFillTabPage.disposeAndClear(); Size aSize(m_aColorSize); - lclExtendSize(aSize, m_aGradientSize); - lclExtendSize(aSize, m_aBitmapSize); - lclExtendSize(aSize, m_aHatchSize); - lclExtendSize(aSize, m_aPatternSize); + lclExtendSize(aSize, aGradientSize); + lclExtendSize(aSize, aBitmapSize); + lclExtendSize(aSize, aHatchSize); + lclExtendSize(aSize, aPatternSize); m_xFillTab->set_size_request(aSize.Width(), aSize.Height()); } diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 87822fc0a1fc..535fa0859ccc 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -498,8 +498,6 @@ class SVT_DLLPUBLIC SvtFontSizeBox FontMetric aFontMetric; const FontList* pFontList; int nSavedValue; - int nMin; - int nMax; FieldUnit eUnit; sal_uInt16 nDecimalDigits; sal_uInt16 nRelMin; @@ -519,7 +517,6 @@ class SVT_DLLPUBLIC SvtFontSizeBox void SetDecimalDigits(sal_uInt16 nDigits) { nDecimalDigits = nDigits; } FieldUnit GetUnit() const { return eUnit; } void SetUnit(FieldUnit _eUnit) { eUnit = _eUnit; } - void SetRange(int nNewMin, int nNewMax) { nMin = nNewMin; nMax = nNewMax; } void SetValue(int nNewValue, FieldUnit eInUnit); void InsertValue(int i); diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index ec86f6ec778e..b0613e294c9f 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -3039,15 +3039,11 @@ class CSSHandler } }; - typedef std::pair<MemStr, MemStr> SelectorName; // element : class - typedef std::vector<SelectorName> SelectorNames; - SelectorNames maSelectorNames; /// current selector names. MemStr maPropName; /// current property name. MemStr maPropValue; /// current property value. - ScHTMLStyles& mrStyles; public: - explicit CSSHandler(ScHTMLStyles& rStyles) : mrStyles(rStyles) {} + explicit CSSHandler() {} static void at_rule_name(const char* /*p*/, size_t /*n*/) { @@ -3070,26 +3066,12 @@ public: static void begin_block() {} - void end_block() - { - maSelectorNames.clear(); - } + static void end_block() {} static void begin_property() {} void end_property() { - SelectorNames::const_iterator itr = maSelectorNames.begin(), itrEnd = maSelectorNames.end(); - for (; itr != itrEnd; ++itr) - { - // Add this property to the collection for each selector. - const SelectorName& rSelName = *itr; - const MemStr& rElem = rSelName.first; - const MemStr& rClass = rSelName.second; - OUString aName(maPropName.mp, maPropName.mn, RTL_TEXTENCODING_UTF8); - OUString aValue(maPropValue.mp, maPropValue.mn, RTL_TEXTENCODING_UTF8); - mrStyles.add(rElem.mp, rElem.mn, rClass.mp, rClass.mn, aName, aValue); - } maPropName = MemStr(); maPropValue = MemStr(); } @@ -3128,7 +3110,7 @@ public: void ScHTMLQueryParser::ParseStyle(const OUString& rStrm) { OString aStr = OUStringToOString(rStrm, RTL_TEXTENCODING_UTF8); - CSSHandler aHdl(GetStyles()); + CSSHandler aHdl; orcus::css_parser<CSSHandler> aParser(aStr.getStr(), aStr.getLength(), aHdl); try { diff --git a/sc/source/filter/inc/defnamesbuffer.hxx b/sc/source/filter/inc/defnamesbuffer.hxx index d4ff3b4a3e7c..45078929e7c8 100644 --- a/sc/source/filter/inc/defnamesbuffer.hxx +++ b/sc/source/filter/inc/defnamesbuffer.hxx @@ -78,14 +78,11 @@ public: /** Returns the original name as imported from or exported to the file. */ const OUString& getUpcaseModelName() const; - /** Returns an Any with a SingleReference or ComplexReference, or an empty Any. */ - css::uno::Any getReference( const ScAddress& rBaseAddr ) const; protected: DefinedNameModel maModel; /// Model data for this defined name. mutable OUString maUpModelName; /// Model name converted to uppercase ASCII. OUString maCalcName; /// Final name used in the Calc document. - css::uno::Any maRefAny; /// Single cell/range reference. }; class DefinedName : public DefinedNameBase diff --git a/sc/source/filter/inc/workbooksettings.hxx b/sc/source/filter/inc/workbooksettings.hxx index 2477ab8d6c8d..5a02c02c228d 100644 --- a/sc/source/filter/inc/workbooksettings.hxx +++ b/sc/source/filter/inc/workbooksettings.hxx @@ -75,7 +75,6 @@ struct CalcSettingsModel bool mbFullPrecision; /// True = use full precision on calculation. bool mbIterate; /// True = allow circular references. bool mbConcurrent; /// True = concurrent calculation enabled. - bool mbUseNlr; /// True = use natural language references in formulas. explicit CalcSettingsModel(); }; diff --git a/sc/source/filter/oox/defnamesbuffer.cxx b/sc/source/filter/oox/defnamesbuffer.cxx index 5bd2e56759b3..82cb436dd075 100644 --- a/sc/source/filter/oox/defnamesbuffer.cxx +++ b/sc/source/filter/oox/defnamesbuffer.cxx @@ -58,11 +58,6 @@ const sal_uInt32 BIFF12_DEFNAME_VBNAME = 0x00000004; const sal_uInt32 BIFF12_DEFNAME_MACRO = 0x00000008; const sal_uInt32 BIFF12_DEFNAME_BUILTIN = 0x00000020; -const sal_uInt16 BIFF_REFFLAG_COL1REL = 0x0001; -const sal_uInt16 BIFF_REFFLAG_ROW1REL = 0x0002; -const sal_uInt16 BIFF_REFFLAG_COL2REL = 0x0004; -const sal_uInt16 BIFF_REFFLAG_ROW2REL = 0x0008; - const OUStringLiteral spcOoxPrefix("_xlnm."); const sal_Char* const sppcBaseNames[] = @@ -130,53 +125,6 @@ OUString lclGetUpcaseModelName( const OUString& rModelName ) return rModelName.toAsciiUpperCase(); } -void lclConvertRefFlags( sal_Int32& ornFlags, sal_Int32& ornAbsPos, sal_Int32& ornRelPos, sal_Int32 nBasePos, sal_Int32 nApiRelFlag, bool bRel ) -{ - if( getFlag( ornFlags, nApiRelFlag ) && !bRel ) - { - // convert relative to absolute - setFlag( ornFlags, nApiRelFlag, false ); - ornAbsPos = nBasePos + ornRelPos; - } - else if( !getFlag( ornFlags, nApiRelFlag ) && bRel ) - { - // convert absolute to relative - setFlag( ornFlags, nApiRelFlag, true ); - ornRelPos = ornAbsPos - nBasePos; - } -} - -void lclConvertSingleRefFlags( SingleReference& orApiRef, const ScAddress& rBaseAddr, bool bColRel, bool bRowRel ) -{ - using namespace ::com::sun::star::sheet::ReferenceFlags; - lclConvertRefFlags( - orApiRef.Flags, orApiRef.Column, orApiRef.RelativeColumn, - sal_Int32( rBaseAddr.Col() ), COLUMN_RELATIVE, bColRel ); - lclConvertRefFlags( - orApiRef.Flags, orApiRef.Row, orApiRef.RelativeRow, - rBaseAddr.Row(), ROW_RELATIVE, bRowRel ); -} - -Any lclConvertReference( const Any& rRefAny, const ScAddress& rBaseAddr, sal_uInt16 nRelFlags ) -{ - if( rRefAny.has< SingleReference >() && !getFlag( nRelFlags, BIFF_REFFLAG_COL2REL ) && !getFlag( nRelFlags, BIFF_REFFLAG_ROW2REL ) ) - { - SingleReference aApiRef; - rRefAny >>= aApiRef; - lclConvertSingleRefFlags( aApiRef, rBaseAddr, getFlag( nRelFlags, BIFF_REFFLAG_COL1REL ), getFlag( nRelFlags, BIFF_REFFLAG_ROW1REL ) ); - return Any( aApiRef ); - } - if( rRefAny.has< ComplexReference >() ) - { - ComplexReference aApiRef; - rRefAny >>= aApiRef; - lclConvertSingleRefFlags( aApiRef.Reference1, rBaseAddr, getFlag( nRelFlags, BIFF_REFFLAG_COL1REL ), getFlag( nRelFlags, BIFF_REFFLAG_ROW1REL ) ); - lclConvertSingleRefFlags( aApiRef.Reference2, rBaseAddr, getFlag( nRelFlags, BIFF_REFFLAG_COL2REL ), getFlag( nRelFlags, BIFF_REFFLAG_ROW2REL ) ); - return Any( aApiRef ); - } - return Any(); -} - } // namespace DefinedNameModel::DefinedNameModel() : @@ -201,34 +149,6 @@ const OUString& DefinedNameBase::getUpcaseModelName() const return maUpModelName; } -Any DefinedNameBase::getReference( const ScAddress& rBaseAddr ) const -{ - if( maRefAny.hasValue() && (maModel.maName.getLength() >= 2) && (maModel.maName[ 0 ] == '\x01') ) - { - sal_Unicode cFlagsChar = getUpcaseModelName()[ 1 ]; - if( ('A' <= cFlagsChar) && (cFlagsChar <= 'P') ) - { - sal_uInt16 nRelFlags = static_cast< sal_uInt16 >( cFlagsChar - 'A' ); - if( maRefAny.has< ExternalReference >() ) - { - ExternalReference aApiExtRef; - maRefAny >>= aApiExtRef; - Any aRefAny = lclConvertReference( aApiExtRef.Reference, rBaseAddr, nRelFlags ); - if( aRefAny.hasValue() ) - { - aApiExtRef.Reference = aRefAny; - return Any( aApiExtRef ); - } - } - else - { - return lclConvertReference( maRefAny, rBaseAddr, nRelFlags ); - } - } - } - return Any(); -} - DefinedName::DefinedName( const WorkbookHelper& rHelper ) : DefinedNameBase( rHelper ), mpScRangeData(nullptr), diff --git a/sc/source/filter/oox/formulaparser.cxx b/sc/source/filter/oox/formulaparser.cxx index 85ae9fa786cc..888f0465a53d 100644 --- a/sc/source/filter/oox/formulaparser.cxx +++ b/sc/source/filter/oox/formulaparser.cxx @@ -465,7 +465,6 @@ protected: ApiToken& getOperandToken( size_t nOpIndex, size_t nTokenIndex ); bool pushOperandToken( sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces = nullptr ); - bool pushAnyOperandToken( const Any& rAny, sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces = nullptr ); template< typename Type > bool pushValueOperandToken( const Type& rValue, sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces = nullptr ); template< typename Type > @@ -480,7 +479,6 @@ protected: bool pushFunctionOperatorToken( const FunctionInfo& rFuncInfo, size_t nParamCount, const WhiteSpaceVec* pLeadingSpaces = nullptr, const WhiteSpaceVec* pClosingSpaces = nullptr ); bool pushOperand( sal_Int32 nOpCode ); - bool pushAnyOperand( const Any& rAny, sal_Int32 nOpCode ); template< typename Type > bool pushValueOperand( const Type& rValue, sal_Int32 nOpCode ); template< typename Type > @@ -734,14 +732,6 @@ bool FormulaParserImpl::pushOperandToken( sal_Int32 nOpCode, const WhiteSpaceVec return true; } -bool FormulaParserImpl::pushAnyOperandToken( const Any& rAny, sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces ) -{ - size_t nSpacesSize = appendWhiteSpaceTokens( pSpaces ); - appendRawToken( nOpCode ) = rAny; - pushOperandSize( nSpacesSize + 1 ); - return true; -} - template< typename Type > bool FormulaParserImpl::pushValueOperandToken( const Type& rValue, sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces ) { @@ -853,11 +843,6 @@ bool FormulaParserImpl::pushOperand( sal_Int32 nOpCode ) return pushOperandToken( nOpCode, &maLeadingSpaces ) && resetSpaces(); } -bool FormulaParserImpl::pushAnyOperand( const Any& rAny, sal_Int32 nOpCode ) -{ - return pushAnyOperandToken( rAny, nOpCode, &maLeadingSpaces ) && resetSpaces(); -} - template< typename Type > bool FormulaParserImpl::pushValueOperand( const Type& rValue, sal_Int32 nOpCode ) { @@ -946,9 +931,6 @@ bool FormulaParserImpl::pushReferenceOperand( const LinkSheetRange& rSheetRange, bool FormulaParserImpl::pushEmbeddedRefOperand( const DefinedNameBase& rName, bool bPushBadToken ) { - Any aRefAny = rName.getReference( maBaseAddr ); - if( aRefAny.hasValue() ) - return pushAnyOperand( aRefAny, OPCODE_PUSH ); if( bPushBadToken && !rName.getModelName().isEmpty() && (rName.getModelName()[ 0 ] >= ' ') ) return pushValueOperand( rName.getModelName(), OPCODE_BAD ); return pushBiffErrorOperand( BIFF_ERR_NAME ); diff --git a/sc/source/filter/oox/workbooksettings.cxx b/sc/source/filter/oox/workbooksettings.cxx index b328b6516ff0..cc7366ffd83f 100644 --- a/sc/source/filter/oox/workbooksettings.cxx +++ b/sc/source/filter/oox/workbooksettings.cxx @@ -97,8 +97,7 @@ CalcSettingsModel::CalcSettingsModel() : mbCalcCompleted( true ), mbFullPrecision( true ), mbIterate( false ), - mbConcurrent( true ), - mbUseNlr( false ) + mbConcurrent( true ) { } @@ -233,7 +232,7 @@ void WorkbookSettings::finalizeImport() aPropSet.setProperty( PROP_IterationCount, maCalcSettings.mnIterateCount ); aPropSet.setProperty( PROP_IterationEpsilon, maCalcSettings.mfIterateDelta ); aPropSet.setProperty( PROP_CalcAsShown, !maCalcSettings.mbFullPrecision ); - aPropSet.setProperty( PROP_LookUpLabels, maCalcSettings.mbUseNlr ); + aPropSet.setProperty( PROP_LookUpLabels, false ); Reference< XNumberFormatsSupplier > xNumFmtsSupp( getDocument(), UNO_QUERY ); if( xNumFmtsSupp.is() ) diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index 41066418063a..b421f13f3630 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -65,7 +65,6 @@ ClientBox::ClientBox( vcl::Window* pParent, WinBits nStyle ) : m_bHasActive( false ), m_bNeedsRecalc( true ), m_bAdjustActive( false ), - m_bInDelete( false ), m_nActive( 0 ), m_nTopIndex( 0 ), m_nActiveHeight( 0 ), @@ -118,11 +117,6 @@ ClientBox::~ClientBox() void ClientBox::dispose() { - if ( ! m_bInDelete ) - DeleteRemoved(); - - m_bInDelete = true; - m_vEntries.clear(); m_xRemoveListener.clear(); @@ -185,20 +179,6 @@ void ClientBox::CalcActiveHeight() return ::tools::Rectangle( aPos, aSize ); } -void ClientBox::DeleteRemoved() -{ - const ::osl::MutexGuard aGuard( m_entriesMutex ); - - m_bInDelete = true; - - if ( ! m_vRemovedEntries.empty() ) - { - m_vRemovedEntries.clear(); - } - - m_bInDelete = false; -} - long ClientBox::GetActiveEntryIndex() { if ( m_bHasActive ) @@ -469,9 +449,6 @@ bool ClientBox::HandleCursorKey( sal_uInt16 nKeyCode ) void ClientBox::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle &/*rPaintRect*/) { - if (!m_bInDelete) - DeleteRemoved(); - if (m_bNeedsRecalc) RecalcAll(); @@ -576,9 +553,6 @@ void ClientBox::MouseButtonDown( const MouseEvent& rMEvt ) bool ClientBox::EventNotify( NotifyEvent& rNEvt ) { - if ( !m_bInDelete ) - DeleteRemoved(); - bool bHandled = false; if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.hxx b/sd/source/ui/dlg/RemoteDialogClientBox.hxx index bdaa5cf77f4a..c839165a79cc 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.hxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.hxx @@ -87,7 +87,6 @@ class ClientBox : public Control bool m_bHasActive : 1; bool m_bNeedsRecalc : 1; bool m_bAdjustActive : 1; - bool m_bInDelete : 1; //Must be guarded together with m_vEntries to ensure a valid index at all times. //Use m_entriesMutex as guard. long m_nActive; @@ -112,14 +111,12 @@ class ClientBox : public Control //while new entries are added / removed in a separate thread. mutable ::osl::Mutex m_entriesMutex; std::vector< TClientBoxEntry > m_vEntries; - std::vector< TClientBoxEntry > m_vRemovedEntries; void CalcActiveHeight(); long GetTotalHeight() const; void SetupScrollBar(); void DrawRow(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect, const TClientBoxEntry& rEntry); bool HandleCursorKey( sal_uInt16 nKeyCode ); - void DeleteRemoved(); DECL_LINK( ScrollHdl, ScrollBar*, void ); DECL_LINK( DeauthoriseHdl, Button*, void ); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 7537c3e8ab31..ddcd4dc0b344 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -102,15 +102,10 @@ class ViewShellObjectBarFactory { public: explicit ViewShellObjectBarFactory (::sd::ViewShell& rViewShell); - virtual ~ViewShellObjectBarFactory() override; virtual SfxShell* CreateShell( ::sd::ShellId nId ) override; virtual void ReleaseShell (SfxShell* pShell) override; private: ::sd::ViewShell& mrViewShell; - /** This cache holds the already created object bars. - */ - typedef ::std::map< ::sd::ShellId,SfxShell*> ShellCache; - ShellCache maShellCache; }; } // end of anonymous namespace @@ -1637,64 +1632,48 @@ ViewShellObjectBarFactory::ViewShellObjectBarFactory ( { } -ViewShellObjectBarFactory::~ViewShellObjectBarFactory() -{ - for (ShellCache::iterator aI(maShellCache.begin()); - aI!=maShellCache.end(); - ++aI) - { - delete aI->second; - } -} - SfxShell* ViewShellObjectBarFactory::CreateShell( ::sd::ShellId nId ) { SfxShell* pShell = nullptr; - ShellCache::iterator aI (maShellCache.find(nId)); - if (aI == maShellCache.end() || aI->second==nullptr) + ::sd::View* pView = mrViewShell.GetView(); + switch (nId) { - ::sd::View* pView = mrViewShell.GetView(); - switch (nId) - { - case ToolbarId::Bezier_Toolbox_Sd: - pShell = new ::sd::BezierObjectBar(&mrViewShell, pView); - break; - - case ToolbarId::Draw_Text_Toolbox_Sd: - pShell = new ::sd::TextObjectBar( - &mrViewShell, mrViewShell.GetDoc()->GetPool(), pView); - break; - - case ToolbarId::Draw_Graf_Toolbox: - pShell = new ::sd::GraphicObjectBar(&mrViewShell, pView); - break; - - case ToolbarId::Draw_Media_Toolbox: - pShell = new ::sd::MediaObjectBar(&mrViewShell, pView); - break; - - case ToolbarId::Draw_Table_Toolbox: - pShell = ::sd::ui::table::CreateTableObjectBar( mrViewShell, pView ); - break; - - case ToolbarId::Svx_Extrusion_Bar: - pShell = new svx::ExtrusionBar( - &mrViewShell.GetViewShellBase()); - break; - - case ToolbarId::Svx_Fontwork_Bar: - pShell = new svx::FontworkBar( - &mrViewShell.GetViewShellBase()); - break; - - default: - pShell = nullptr; - break; - } + case ToolbarId::Bezier_Toolbox_Sd: + pShell = new ::sd::BezierObjectBar(&mrViewShell, pView); + break; + + case ToolbarId::Draw_Text_Toolbox_Sd: + pShell = new ::sd::TextObjectBar( + &mrViewShell, mrViewShell.GetDoc()->GetPool(), pView); + break; + + case ToolbarId::Draw_Graf_Toolbox: + pShell = new ::sd::GraphicObjectBar(&mrViewShell, pView); + break; + + case ToolbarId::Draw_Media_Toolbox: + pShell = new ::sd::MediaObjectBar(&mrViewShell, pView); + break; + + case ToolbarId::Draw_Table_Toolbox: + pShell = ::sd::ui::table::CreateTableObjectBar( mrViewShell, pView ); + break; + + case ToolbarId::Svx_Extrusion_Bar: + pShell = new svx::ExtrusionBar( + &mrViewShell.GetViewShellBase()); + break; + + case ToolbarId::Svx_Fontwork_Bar: + pShell = new svx::FontworkBar( + &mrViewShell.GetViewShellBase()); + break; + + default: + pShell = nullptr; + break; } - else - pShell = aI->second; return pShell; } diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 27b0dd71d304..432663803437 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1701,8 +1701,6 @@ sal_Int64 FontSizeBox::GetValueFromStringUnit(const OUString& rStr, FieldUnit eO SvtFontSizeBox::SvtFontSizeBox(std::unique_ptr<weld::ComboBox> p) : pFontList(nullptr) , nSavedValue(0) - , nMin(20) - , nMax(9999) , eUnit(FUNIT_POINT) , nDecimalDigits(1) , nRelMin(0) @@ -1918,7 +1916,6 @@ void SvtFontSizeBox::SetRelative( bool bNewRelative ) if (bPtRelative) { SetDecimalDigits( 1 ); - SetRange(nPtRelMin, nPtRelMax); SetUnit(FUNIT_POINT); short i = nPtRelMin, n = 0; @@ -1932,7 +1929,6 @@ void SvtFontSizeBox::SetRelative( bool bNewRelative ) else { SetDecimalDigits(0); - SetRange(nRelMin, nRelMax); SetUnit(FUNIT_PERCENT); sal_uInt16 i = nRelMin; @@ -1949,7 +1945,6 @@ void SvtFontSizeBox::SetRelative( bool bNewRelative ) m_xComboBox->clear(); bRelative = bPtRelative = false; SetDecimalDigits(1); - SetRange(20, 9999); SetUnit(FUNIT_POINT); if ( pFontList) Fill( &aFontMetric, pFontList ); diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index 93c74e23f7c4..85ca9b2862f8 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -85,7 +85,6 @@ class GlobalEventConfig_Impl : public utl::ConfigItem { private: EventBindingHash m_eventBindingHash; - FrameVector m_lFrames; SupportedEventsVector m_supportedEvents; void initBindingInfo(); @@ -154,20 +153,6 @@ void GlobalEventConfig_Impl::Notify( const Sequence< OUString >& ) MutexGuard aGuard( GlobalEventConfig::GetOwnStaticMutex() ); initBindingInfo(); - - // don't forget to update all existing frames and her might cached dispatch objects! - // But look for already killed frames. We hold weak references instead of hard ones ... - for (FrameVector::iterator pIt = m_lFrames.begin(); pIt != m_lFrames.end(); ) - { - css::uno::Reference< css::frame::XFrame > xFrame(pIt->get(), css::uno::UNO_QUERY); - if (xFrame.is()) - { - xFrame->contextChanged(); - ++pIt; - } - else - pIt = m_lFrames.erase(pIt); - } } // public method diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index 626e3ccd9403..f0021b28388c 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -195,7 +195,6 @@ namespace vcl std::map< OUString, std::vector< VclPtr<vcl::Window> > > maPropertyToWindowMap; std::map< VclPtr<vcl::Window>, sal_Int32 > maControlToNumValMap; - std::set< OUString > maReverseDependencySet; Size maNupPortraitSize; Size maNupLandscapeSize; diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 819b3c7ca6e3..725cba29a8d0 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1303,23 +1303,6 @@ void PrintDialog::checkOptionalControlDependencies() it != maControlToPropertyMap.end(); ++it ) { bool bShouldbeEnabled = maPController->isUIOptionEnabled( it->second ); - if( ! bShouldbeEnabled ) - { - // enable controls that are directly attached to a dependency anyway - // if the normally disabled controls get modified, change the dependency - // so the control would be enabled - // example: in print range "Print All" is selected, "Page Range" is then of course - // not selected and the Edit for the Page Range would be disabled - // as a convenience we should enable the Edit anyway and automatically select - // "Page Range" instead of "Print All" if the Edit gets modified - if( maReverseDependencySet.find( it->second ) != maReverseDependencySet.end() ) - { - OUString aDep( maPController->getDependency( it->second ) ); - // if the dependency is at least enabled, then enable this control anyway - if( !aDep.isEmpty() && maPController->isUIOptionEnabled( aDep ) ) - bShouldbeEnabled = true; - } - } if( bShouldbeEnabled && dynamic_cast<RadioButton*>(it->first.get()) ) { diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 5fd173689ba9..ef68129496d6 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -106,7 +106,7 @@ static char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*ar } SecurityEnvironment_NssImpl::SecurityEnvironment_NssImpl() : -m_pHandler( nullptr ) , m_tSymKeyList() , m_tPubKeyList() , m_tPriKeyList() { +m_pHandler( nullptr ) , m_tSymKeyList() { PK11_SetPasswordFunc( GetPasswordFunction ) ; } @@ -123,16 +123,6 @@ SecurityEnvironment_NssImpl::~SecurityEnvironment_NssImpl() { for( auto& symKey : m_tSymKeyList ) PK11_FreeSymKey( symKey ) ; } - - if( !m_tPubKeyList.empty() ) { - for( auto& pubKeyIt : m_tPubKeyList ) - SECKEY_DestroyPublicKey( pubKeyIt ) ; - } - - if( !m_tPriKeyList.empty() ) { - for( auto& priKey : m_tPriKeyList ) - SECKEY_DestroyPrivateKey( priKey ) ; - } } /* XServiceInfo */ @@ -313,15 +303,6 @@ SecurityEnvironment_NssImpl::getPersonalCertificates() } - //secondly, we try to find certificate from registered private keys. - if( !m_tPriKeyList.empty() ) { - for( const auto& priKey : m_tPriKeyList ) { - xcert = NssPrivKeyToXCert( priKey ) ; - if( xcert != nullptr ) - certsList.push_back( xcert ) ; - } - } - length = certsList.size() ; if( length != 0 ) { int i = 0; diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx index c61ade4ab876..aec7f5bbcead 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx @@ -60,8 +60,6 @@ private: CERTCertDBHandle* m_pHandler ; std::list< PK11SymKey* > m_tSymKeyList ; - std::list< SECKEYPublicKey* > m_tPubKeyList ; - std::list< SECKEYPrivateKey* > m_tPriKeyList ; public: SecurityEnvironment_NssImpl(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits