diff options
author | Noel <noelgrandin@gmail.com> | 2020-09-30 09:39:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-09-30 11:48:48 +0200 |
commit | 7ced53424a21ab264374d97aacdfb4ec166c8171 (patch) | |
tree | a119f33d08617939ed0a8c8dc4870c7832443506 /svx | |
parent | 6b709ad5d46dc33f29ec28183cea40cf9e77e2af (diff) |
loplugin:reducevarscope in svx
Change-Id: I88fdaa74c4944f9ffc81db6df08a29283362375a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103647
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
25 files changed, 36 insertions, 49 deletions
diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index 00959017dd4d..824a2a51382d 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -339,10 +339,9 @@ void SvxRectCtlAccessibleContext::selectChild( long nNew ) long nNumOfChildren = getAccessibleChildCount(); if( nNew < nNumOfChildren ) { // valid index - SvxRectCtlChildAccessibleContext* pChild; if( mnSelectedChild != NOCHILDSELECTED ) { // deselect old selected child if one is selected - pChild = mvChildren[ mnSelectedChild ].get(); + SvxRectCtlChildAccessibleContext* pChild = mvChildren[ mnSelectedChild ].get(); if( pChild ) pChild->setStateChecked( false ); } diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 1e42bc0b720b..6e463f09dcaf 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -2757,11 +2757,9 @@ void EnhancedCustomShape2d::AdaptObjColor( default: case drawing::FillStyle_SOLID: { - Color aFillColor; - if ( nColorCount || 0.0 != dBrightness ) { - aFillColor = GetColorData( + Color aFillColor = GetColorData( rCustomShapeSet.Get( XATTR_FILLCOLOR ).GetColorValue(), std::min(nColorIndex, nColorCount-1), dBrightness ); diff --git a/svx/source/dialog/hyperdlg.cxx b/svx/source/dialog/hyperdlg.cxx index 1bbc40e759d9..c7ae9fc51c4c 100644 --- a/svx/source/dialog/hyperdlg.cxx +++ b/svx/source/dialog/hyperdlg.cxx @@ -43,10 +43,9 @@ SvxHlinkDlgWrapper::SvxHlinkDlgWrapper( vcl::Window* _pParent, sal_uInt16 nId, SetController( mpDlg->GetController() ); SetVisible_Impl(false); - vcl::Window* pTopWindow = nullptr; if ( !pInfo->aSize.IsEmpty() ) { - pTopWindow = SfxGetpApp()->GetTopWindow(); + vcl::Window* pTopWindow = SfxGetpApp()->GetTopWindow(); if (pTopWindow) { weld::Dialog* pDialog = GetController()->getDialog(); diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 51fee17c8ce6..0ca5a122677f 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -122,11 +122,10 @@ void IMapWindow::ReplaceImageMap( const ImageMap& rImageMap ) void IMapWindow::ReplaceActualIMapInfo( const NotifyInfo& rNewInfo ) { const SdrObject* pSdrObj = GetSelectedSdrObject(); - IMapObject* pIMapObj; if ( pSdrObj ) { - pIMapObj = GetIMapObj( pSdrObj ); + IMapObject* pIMapObj = GetIMapObj( pSdrObj ); if (pIMapObj) { pIMapObj->SetURL( rNewInfo.aMarkURL ); diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 78d7a5676f44..adaf99f412e7 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -452,12 +452,12 @@ void SvxSearchDialog::Construct_Impl() // vnd.sun.star::SearchViaComponent1 and 2 are supported const uno::Reference< frame::XFrame >xFrame = rBindings.GetActiveFrame(); const uno::Reference< frame::XDispatchProvider > xDispatchProv(xFrame, uno::UNO_QUERY); - OUString sTarget("_self"); bool bSearchComponent1 = false; bool bSearchComponent2 = false; if(xDispatchProv.is()) { + OUString sTarget("_self"); pImpl->xCommand1Dispatch = xDispatchProv->queryDispatch(pImpl->aCommand1URL, sTarget, 0); if (pImpl->xCommand1Dispatch.is()) bSearchComponent1 = true; diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 767d944a9abe..c58de4031058 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -757,12 +757,11 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe return; SfxViewFrame* pCurrentFrame = SfxViewFrame::Current(); - SfxItemState eState = SfxItemState::UNKNOWN; // ask the bindings of the current view frame (which should be the one we're residing in) for the state if (pCurrentFrame) { std::unique_ptr<SfxPoolItem> pItem; - eState = pCurrentFrame->GetBindings().QueryState(SID_FM_CTL_PROPERTIES, pItem); + SfxItemState eState = pCurrentFrame->GetBindings().QueryState(SID_FM_CTL_PROPERTIES, pItem); if (eState >= SfxItemState::DEFAULT && pItem != nullptr) { diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index ca0c86e34a22..5b24bbc85e72 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -781,8 +781,6 @@ namespace svxform void XFormsPage::EditEntry( const Reference< XPropertySet >& _rEntry ) { - OUString sTemp; - if ( DGTSubmission != m_eGroup ) return; @@ -801,6 +799,7 @@ namespace svxform if (!m_xItemList->iter_has_child(*xEntry)) m_xItemList->iter_parent(*xEntry); + OUString sTemp; _rEntry->getPropertyValue( PN_SUBMISSION_ID ) >>= sTemp; m_xItemList->set_text(*xEntry, sTemp); @@ -2155,7 +2154,7 @@ namespace svxform IMPL_LINK(AddDataItemDialog, ConditionHdl, weld::Button&, rBtn, void) { - OUString sTemp, sPropName; + OUString sPropName; if ( m_xDefaultBtn.get() == &rBtn ) sPropName = PN_BINDING_EXPR; else if ( m_xRequiredBtn.get() == &rBtn ) @@ -2175,6 +2174,7 @@ namespace svxform sCondition = m_xDefaultED->get_text(); else { + OUString sTemp; m_xTempBinding->getPropertyValue( sPropName ) >>= sTemp; if ( sTemp.isEmpty() ) sTemp = TRUE_VALUE; @@ -2387,10 +2387,10 @@ namespace svxform TOOLS_WARN_EXCEPTION( "svx.form", "AddDataItemDialog::InitFromNode()" ); } } - OUString sTemp; try { Reference< XPropertySetInfo > xInfo = m_pItemNode->m_xPropSet->getPropertySetInfo(); + OUString sTemp; if ( xInfo->hasPropertyByName( PN_BINDING_ID ) ) { m_pItemNode->m_xPropSet->getPropertyValue( PN_BINDING_ID ) >>= sTemp; @@ -2414,9 +2414,9 @@ namespace svxform if ( m_xTempBinding.is() ) { - OUString sTemp; try { + OUString sTemp; if ( ( m_xTempBinding->getPropertyValue( PN_REQUIRED_EXPR ) >>= sTemp ) && !sTemp.isEmpty() ) m_xRequiredCB->set_active(true); @@ -2977,9 +2977,9 @@ namespace svxform if ( m_pItemNode && m_pItemNode->m_xPropSet.is() ) { m_xSubmission = m_pItemNode->m_xPropSet; - OUString sTemp; try { + OUString sTemp; m_xSubmission->getPropertyValue( PN_SUBMISSION_ID ) >>= sTemp; m_xNameED->set_text( sTemp ); m_xSubmission->getPropertyValue( PN_SUBMISSION_ACTION ) >>= sTemp; diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 1e24c6c4a946..0f91315bf94d 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -3082,7 +3082,6 @@ void FmXFormShell::CreateExternalView_Lock() // the frame the external view is displayed in bool bAlreadyExistent = m_xExternalViewController.is(); Reference< css::frame::XFrame> xExternalViewFrame; - OUString sFrameName("_beamer"); Reference<runtime::XFormController> xCurrentNavController(getNavController_Lock()); // the creation of the "partwindow" may cause a deactivate of the document which will result in our nav controller to be set to NULL @@ -3123,6 +3122,7 @@ void FmXFormShell::CreateExternalView_Lock() // load the component for external form views if (!bAlreadyExistent) { + OUString sFrameName("_beamer"); URL aWantToDispatch; aWantToDispatch.Complete = FMURL_COMPONENT_FORMGRIDVIEW; diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 23475041866c..edbe9ff49b93 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -796,12 +796,13 @@ void FormController::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons OUString sFilterValue( condition->second ); - OUString sErrorMsg, sCriteria; + OUString sErrorMsg; const std::unique_ptr< OSQLParseNode > pParseNode = predicateTree( sErrorMsg, sFilterValue, xFormatter, xField ); OSL_ENSURE( pParseNode != nullptr, "FormController::getFastPropertyValue: could not parse the field value predicate!" ); if ( pParseNode != nullptr ) { + OUString sCriteria; // don't use a parse context here, we need it unlocalized pParseNode->parseNodeToStr( sCriteria, xConnection ); if ( condition != rRow.begin() ) diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 750fd1491220..c522fdf49e93 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -355,7 +355,6 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO { INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( "sdg" ); INetURLObject aSdvURL( aThmURL ); aSdvURL.SetExtension( "sdv" ); - OUString aTitle; try { @@ -363,6 +362,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO ::ucbhelper::Content aSdgCnt( aSdgURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xEnv, comphelper::getProcessComponentContext() ); ::ucbhelper::Content aSdvCnt( aSdvURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xEnv, comphelper::getProcessComponentContext() ); + OUString aTitle; try { aThmCnt.getPropertyValue( s_sTitle ) >>= aTitle; diff --git a/svx/source/gallery2/gallerybinaryengineentry.cxx b/svx/source/gallery2/gallerybinaryengineentry.cxx index 0b0831169a4d..8537d52b2a9d 100644 --- a/svx/source/gallery2/gallerybinaryengineentry.cxx +++ b/svx/source/gallery2/gallerybinaryengineentry.cxx @@ -85,7 +85,6 @@ GalleryThemeEntry* GalleryBinaryEngineEntry::CreateThemeEntry(const INetURLObjec if (pIStm) { - OUString aThemeName; sal_uInt16 nVersion; pIStm->ReadUInt16(nVersion); @@ -96,7 +95,7 @@ GalleryThemeEntry* GalleryBinaryEngineEntry::CreateThemeEntry(const INetURLObjec sal_uInt32 nThemeId = 0; OString aTmpStr = read_uInt16_lenPrefixed_uInt8s_ToOString(*pIStm); - aThemeName = OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); + OUString aThemeName = OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); // execute a character conversion if (nVersion >= 0x0004) diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index e6dcf1acf75c..2319328dc8f9 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -686,7 +686,6 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) std::unique_ptr<GalleryObject> pObj(new GalleryObject); OUString aFileName; - OUString aPath; sal_uInt16 nTemp; rIStm.ReadCharAsBool( bRel ); @@ -702,7 +701,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) if( bRel ) { aFileName = aFileName.replaceAll( "\\", "/" ); - aPath = aRelURL1.GetMainURL( INetURLObject::DecodeMechanism::NONE ); + OUString aPath = aRelURL1.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if( aFileName[ 0 ] != '/' ) aPath += "/"; diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index a32230c70dde..6a3acbb0e81a 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -1237,10 +1237,10 @@ short SvxNumberFormatShell::GetCategory4Entry(short nEntry) const if (nMyNfEntry != NUMBERFORMAT_ENTRY_NOT_FOUND) { const SvNumberformat* pNumEntry = pFormatter->GetEntry(nMyNfEntry); - sal_uInt16 nMyType; if (pNumEntry != nullptr) { SvNumFormatType nMyCat = pNumEntry->GetMaskedType(); + sal_uInt16 nMyType; CategoryToPos_Impl(nMyCat, nMyType); return static_cast<short>(nMyType); diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx index 08a5a5c00a32..f3e9c9633ccd 100644 --- a/svx/source/sdr/overlay/overlayobjectlist.cxx +++ b/svx/source/sdr/overlay/overlayobjectlist.cxx @@ -108,7 +108,7 @@ namespace sdr::overlay bool OverlayObjectList::isHitPixel(const Point& rDiscretePosition) const { - sal_uInt32 nDiscreteTolerance = DEFAULT_VALUE_FOR_HITTEST_PIXEL; + constexpr sal_uInt32 nDiscreteTolerance = DEFAULT_VALUE_FOR_HITTEST_PIXEL; if(!maVector.empty()) { OverlayObject* pCandidate = maVector.front().get(); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 9a3380e8b2b9..001fe3580b86 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -745,11 +745,10 @@ BitmapEx ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, BitmapColorIndex eIndex) // use this code path only when we use HiDPI (for now) if (Application::GetDefaultDevice()->GetDPIScalePercentage() > 100) { - OUString sMarkerPrefix("svx/res/marker-"); - OUString sMarkerName = appendMarkerName(eKindOfMarker); if (!sMarkerName.isEmpty()) { + OUString sMarkerPrefix("svx/res/marker-"); BitmapEx aBitmapEx; if (eKindOfMarker == BitmapMarkerKind::Crosshair @@ -1373,8 +1372,6 @@ void SdrHdlGradient::FromIAOToItem(SdrObject* _pObj, bool bSetItemOnObject, bool GradTransGradient aGradTransGradient; GradTransVector aGradTransVector; - OUString aString; - aGradTransVector.maPositionA = basegfx::B2DPoint(GetPos().X(), GetPos().Y()); aGradTransVector.maPositionB = basegfx::B2DPoint(Get2ndPos().X(), Get2ndPos().Y()); if(pColHdl1) @@ -1394,16 +1391,15 @@ void SdrHdlGradient::FromIAOToItem(SdrObject* _pObj, bool bSetItemOnObject, bool { SdrModel& rModel(_pObj->getSdrModelFromSdrObject()); SfxItemSet aNewSet(rModel.GetItemPool()); + const OUString aString; if(IsGradient()) { - aString.clear(); XFillGradientItem aNewGradItem(aString, aGradTransGradient.aGradient); aNewSet.Put(aNewGradItem); } else { - aString.clear(); XFillFloatTransparenceItem aNewTransItem(aString, aGradTransGradient.aGradient); aNewSet.Put(aNewTransItem); } diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index c3afe2ccb352..81b5dbaad0c4 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -1867,9 +1867,9 @@ SvxNumType SdrModel::GetPageNumType() const void SdrModel::ReadUserDataSequenceValue(const css::beans::PropertyValue* pValue) { - bool bBool = false; if (pValue->Name == "AnchoredTextOverflowLegacy") { + bool bBool = false; if (pValue->Value >>= bBool) { mpImpl->mbAnchoredTextOverflowLegacy = bBool; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 3e7391d8123c..fd708af04550 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2083,8 +2083,8 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat ) std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() ); - sal_uInt32 const nDefaultObjectSizeWidth = 3000; // default width from SDOptions ? - sal_uInt32 const nDefaultObjectSizeHeight= 3000; + constexpr sal_uInt32 nDefaultObjectSizeWidth = 3000; // default width from SDOptions ? + constexpr sal_uInt32 nDefaultObjectSizeHeight= 3000; if ( ImpVerticalSwitch( *this ) ) { diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index d74e5e8bf800..2cf43d6669e8 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1086,9 +1086,8 @@ PointerStyle SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDe SdrHdl* pH2=maHdlList.GetHdl(SdrHdlKind::Ref2); bool b90=false; bool b45=false; - Point aDif; if (pH1!=nullptr && pH2!=nullptr) { - aDif=pH2->GetPos()-pH1->GetPos(); + Point aDif = pH2->GetPos()-pH1->GetPos(); b90=(aDif.X()==0) || aDif.Y()==0; b45=b90 || (std::abs(aDif.X())==std::abs(aDif.Y())); } diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 1b52f835180c..b28522619bc6 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -2229,9 +2229,10 @@ void SvxTableController::selectAll() { if( mxTable.is() ) { - CellPos aPos1, aPos2( mxTable->getColumnCount()-1, mxTable->getRowCount()-1 ); + CellPos aPos2( mxTable->getColumnCount()-1, mxTable->getRowCount()-1 ); if( (aPos2.mnCol >= 0) && (aPos2.mnRow >= 0) ) { + CellPos aPos1; setSelectedCells( aPos1, aPos2 ); } } diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx index 6bd4f54ecba8..a36cd5203263 100644 --- a/svx/source/tbxctrls/StylesPreviewWindow.cxx +++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx @@ -451,7 +451,6 @@ void StylesPreviewWindow_Base::UpdateStylesList() m_aAllStyles = m_aDefaultStyles; SfxObjectShell* pDocShell = SfxObjectShell::Current(); - const SfxStyleFamily eFamily = SfxStyleFamily::Para; SfxStyleSheetBasePool* pStyleSheetPool = nullptr; if (pDocShell) @@ -459,7 +458,8 @@ void StylesPreviewWindow_Base::UpdateStylesList() if (pStyleSheetPool) { - auto xIter = pStyleSheetPool->CreateIterator(eFamily, SfxStyleSearchBits::UserDefined); + auto xIter = pStyleSheetPool->CreateIterator(SfxStyleFamily::Para, + SfxStyleSearchBits::UserDefined); SfxStyleSheetBase* pStyle = xIter->First(); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 6b0f393bf28a..6d46b52ac94d 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1336,7 +1336,7 @@ void SvxStyleBox_Base::CalcOptimalExtraUserWidth(vcl::RenderContext& rRenderCont // when the color is R=G=B=128 the DecreaseContrast make 128 the need an exception Color SvxStyleBox_Base::TestColorsVisible(const Color &FontCol, const Color &BackCol) { - const sal_uInt8 ChgVal = 60; // increase/decrease the Contrast + constexpr sal_uInt8 ChgVal = 60; // increase/decrease the Contrast Color retCol = FontCol; if ((FontCol.IsDark() == BackCol.IsDark()) && (FontCol.IsBright() == BackCol.IsBright())) diff --git a/svx/source/unodraw/gluepts.cxx b/svx/source/unodraw/gluepts.cxx index d1eaa2fbc847..5311def81e18 100644 --- a/svx/source/unodraw/gluepts.cxx +++ b/svx/source/unodraw/gluepts.cxx @@ -372,11 +372,11 @@ void SAL_CALL SvxUnoGluePointAccess::insertByIndex( sal_Int32, const uno::Any& E SdrGluePointList* pList = mpObject->ForceGluePointList(); if( pList ) { - SdrGluePoint aSdrGlue; drawing::GluePoint2 aUnoGlue; if( Element >>= aUnoGlue ) { + SdrGluePoint aSdrGlue; convert( aUnoGlue, aSdrGlue ); pList->Insert( aSdrGlue ); diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 6a5bd4febfe8..e0ade5699832 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -439,9 +439,9 @@ void SvxTextEditSourceImpl::SetupOutliner() return; SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject ); - tools::Rectangle aPaintRect; if( pTextObj ) { + tools::Rectangle aPaintRect; tools::Rectangle aBoundRect( pTextObj->GetCurrentBoundRect() ); pTextObj->SetupOutlinerFormatting( *mpOutliner, aPaintRect ); @@ -460,9 +460,9 @@ void SvxTextEditSourceImpl::UpdateOutliner() return; SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject ); - tools::Rectangle aPaintRect; if( pTextObj ) { + tools::Rectangle aPaintRect; tools::Rectangle aBoundRect( pTextObj->GetCurrentBoundRect() ); pTextObj->UpdateOutlinerFormatting( *mpOutliner, aPaintRect ); diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx index 195ebf9c8903..f9407cb46698 100644 --- a/svx/source/xml/xmlxtexp.cxx +++ b/svx/source/xml/xmlxtexp.cxx @@ -200,11 +200,9 @@ bool SvxXMLXTableExportComponent::save( bool bRet = false; std::unique_ptr<SfxMedium> pMedium; rtl::Reference<SvXMLGraphicHelper> xGraphicHelper; - sal_Int32 eCreate = embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE; INetURLObject aURLObj( rURL ); bool bToStorage = aURLObj.GetProtocol() == INetProtocol::NotValid; // a relative path - bool bSaveAsStorage = xTable->getElementType() == cppu::UnoType<awt::XBitmap>::get(); if( pOptName ) @@ -220,6 +218,7 @@ bool SvxXMLXTableExportComponent::save( uno::Reference < io::XOutputStream > xOut; uno::Reference<embed::XStorage > xSubStorage; uno::Reference<XGraphicStorageHandler> xGraphicStorageHandler; + const sal_Int32 eCreate = embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE; if( !bToStorage || !xStorage.is() ) { // local URL -> SfxMedium route diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 38fc3db95a00..bff4092d9f6e 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -112,7 +112,6 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, OUString aExt; GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); ErrCode nErr = ERRCODE_GRFILTER_FILTERERROR; - sal_uInt16 nFilter = GRFILTER_FORMAT_NOTFOUND; bool bTransparent = rGraphic.IsTransparent(), bAnimated = rGraphic.IsAnimated(); DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "XOutBitmap::WriteGraphic(...): invalid URL" ); @@ -221,7 +220,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, if( bWriteTransGrf ) aFilter = FORMAT_GIF; - nFilter = rFilter.GetExportFormatNumberForShortName( aFilter ); + sal_uInt16 nFilter = rFilter.GetExportFormatNumberForShortName( aFilter ); if( GRFILTER_FORMAT_NOTFOUND == nFilter ) { |