sd/qa/unit/SVGExportTests.cxx | 3 sd/qa/unit/import-tests.cxx | 2 sd/source/core/drawdoc4.cxx | 4 sd/source/core/pglink.cxx | 4 sd/source/core/sdpage.cxx | 12 -- sd/source/core/stlpool.cxx | 3 sd/source/core/stlsheet.cxx | 3 sd/source/filter/eppt/eppt.cxx | 9 -- sd/source/filter/eppt/epptso.cxx | 20 ++-- sd/source/filter/eppt/pptexanimations.cxx | 74 ++++++++---------- sd/source/filter/eppt/pptx-epptooxml.cxx | 6 - sd/source/filter/eppt/pptx-stylesheet.cxx | 2 sd/source/filter/grf/sdgrffilter.cxx | 3 sd/source/filter/html/pubdlg.cxx | 3 sd/source/filter/sdfilter.cxx | 3 sd/source/filter/xml/sdxmlwrp.cxx | 15 +-- sd/source/ui/animations/motionpathtag.cxx | 4 sd/source/ui/annotations/annotationtag.cxx | 6 - sd/source/ui/dlg/LayerTabBar.cxx | 6 - sd/source/ui/dlg/PhotoAlbumDialog.cxx | 6 - sd/source/ui/dlg/TemplateScanner.cxx | 10 -- sd/source/ui/dlg/animobjs.cxx | 2 sd/source/ui/dlg/dlgolbul.cxx | 3 sd/source/ui/docshell/docshel4.cxx | 5 - sd/source/ui/framework/factories/ViewShellWrapper.cxx | 4 sd/source/ui/func/bulmaper.cxx | 12 -- sd/source/ui/func/fuformatpaintbrush.cxx | 3 sd/source/ui/func/fuinsfil.cxx | 3 sd/source/ui/func/fuolbull.cxx | 3 sd/source/ui/func/fuprobjs.cxx | 28 +++--- sd/source/ui/func/futext.cxx | 6 - sd/source/ui/remotecontrol/BluetoothServer.cxx | 3 sd/source/ui/remotecontrol/Receiver.cxx | 3 sd/source/ui/sidebar/MasterPageContainer.cxx | 3 sd/source/ui/sidebar/MasterPageContainerProviders.cxx | 3 sd/source/ui/tools/IdleDetection.cxx | 4 sd/source/ui/tools/PreviewRenderer.cxx | 2 sd/source/ui/unoidl/SdUnoSlideView.cxx | 4 sd/source/ui/view/ViewShellBase.cxx | 7 - sd/source/ui/view/drtxtob1.cxx | 3 sd/source/ui/view/drviews2.cxx | 3 sd/source/ui/view/drviews3.cxx | 12 -- sd/source/ui/view/drviews4.cxx | 6 - sd/source/ui/view/drviews6.cxx | 3 sd/source/ui/view/drviewsa.cxx | 3 sd/source/ui/view/drviewsd.cxx | 6 - sd/source/ui/view/sdview2.cxx | 3 sd/source/ui/view/viewshel.cxx | 6 - 48 files changed, 133 insertions(+), 208 deletions(-)
New commits: commit b59b4a38b45e1bf158701355c8c70f1c59f3e112 Author: Noel Grandin <[email protected]> Date: Sun Jun 25 19:10:54 2017 +0200 loplugin:oncevar in sd Change-Id: I56649b4df8c517f152ed4e9132985bbef22f8634 Reviewed-on: https://gerrit.libreoffice.org/39241 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx index d241822caecc..c976436a6f89 100644 --- a/sd/qa/unit/SVGExportTests.cxx +++ b/sd/qa/unit/SVGExportTests.cxx @@ -57,8 +57,7 @@ protected: { uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; - OUString aFilterName("impress_svg_Export"); - aMediaDescriptor["FilterName"] <<= aFilterName; + aMediaDescriptor["FilterName"] <<= OUString("impress_svg_Export"); xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); } diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 73e89b3d13ff..6f75439da31e 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -284,7 +284,7 @@ void SdImportTest::testDocumentLayout() for ( int i = 0; i < static_cast< int >( SAL_N_ELEMENTS( aFilesToCompare ) ); ++i ) { - int nUpdateMe = -1; // index of test we want to update; supposedly only when the test is created + int const nUpdateMe = -1; // index of test we want to update; supposedly only when the test is created sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc( "/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pInput ), aFilesToCompare[i].nFormat ); if( aFilesToCompare[i].nExportType >= 0 ) diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index d4290d037a27..5bc477b0f535 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -539,11 +539,9 @@ void SdDrawDocument::CreateDefaultCellStyles() // ---- Default ----------------------------------------------- - sal_uInt16 nMask = SFXSTYLEBIT_AUTO; - OUString aDefaultCellStyleName( "default" ); - pSheet = &(pSSPool->Make(aDefaultCellStyleName, SD_STYLE_FAMILY_CELL, nMask)); + pSheet = &(pSSPool->Make(aDefaultCellStyleName, SD_STYLE_FAMILY_CELL, SFXSTYLEBIT_AUTO)); pSheet->SetHelpId( aHelpFile, HID_SD_CELL_STYLE_DEFAULT ); SfxItemSet& rISet = pSheet->GetItemSet(); diff --git a/sd/source/core/pglink.cxx b/sd/source/core/pglink.cxx index 4e4c3739f6d4..5babf1791088 100644 --- a/sd/source/core/pglink.cxx +++ b/sd/source/core/pglink.cxx @@ -91,8 +91,6 @@ SdPageLink::~SdPageLink() std::vector<OUString> aBookmarkList; aBookmarkList.push_back(aBookmarkName); sal_uInt16 nInsertPos = pPage->GetPageNum(); - bool bLink = true; - bool bReplace = true; bool bNoDialogs = false; bool bCopy = false; @@ -103,7 +101,7 @@ SdPageLink::~SdPageLink() bCopy = true; } - pDoc->InsertBookmarkAsPage(aBookmarkList, nullptr, bLink, bReplace, + pDoc->InsertBookmarkAsPage(aBookmarkList, nullptr, true/*bLink*/, true/*bReplace*/, nInsertPos, bNoDialogs, nullptr, bCopy, true, true); if (!SdDrawDocument::s_pDocLockedInsertingLinks) diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 1af632010fe6..e28162b9e786 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1943,11 +1943,8 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN /********************************************************** * presentation template: adjust test height **********************************************************/ - sal_uInt16 nIndexTitle = 0; - sal_uInt16 nIndexOutline = 0; - sal_uInt16 nIndexNotes = 0; - if (pObj == GetPresObj(PRESOBJ_TITLE, nIndexTitle)) + if (pObj == GetPresObj(PRESOBJ_TITLE, 0)) { SfxStyleSheet* pTitleSheet = GetStyleSheetForPresObj(PRESOBJ_TITLE); @@ -1979,7 +1976,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN pTitleSheet->Broadcast(SfxHint(SfxHintId::DataChanged)); } } - else if (pObj == GetPresObj(PRESOBJ_OUTLINE, nIndexOutline)) + else if (pObj == GetPresObj(PRESOBJ_OUTLINE, 0)) { OUString aName(GetLayoutName()); aName += " "; @@ -2040,7 +2037,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN } } } - else if (pObj == GetPresObj(PRESOBJ_NOTES, nIndexNotes)) + else if (pObj == GetPresObj(PRESOBJ_NOTES, 0)) { SfxStyleSheet* pNotesSheet = GetStyleSheetForPresObj(PRESOBJ_NOTES); @@ -2556,8 +2553,7 @@ void SdPage::SetLayoutName(const OUString& aName) if( mbMaster ) { - OUString aSep(SD_LT_SEPARATOR); - sal_Int32 nPos = maLayoutName.indexOf(aSep); + sal_Int32 nPos = maLayoutName.indexOf(SD_LT_SEPARATOR); if (nPos != -1) FmFormPage::SetName(maLayoutName.copy(0, nPos)); } diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 396f58a9000b..6cbbe54b5d2e 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -796,10 +796,9 @@ void SdStyleSheetPool::CopyLayoutSheets(const OUString& rLayoutName, SdStyleShee void SdStyleSheetPool::CreateLayoutSheetNames(const OUString& rLayoutName, std::vector<OUString> &aNameList) { OUString aPrefix(rLayoutName + SD_LT_SEPARATOR); - OUString aName(STR_LAYOUT_OUTLINE); for (sal_Int32 nLevel = 1; nLevel < 10; nLevel++) - aNameList.push_back( aPrefix + aName + " " + OUString::number( nLevel ) ); + aNameList.push_back( aPrefix + STR_LAYOUT_OUTLINE " " + OUString::number( nLevel ) ); aNameList.push_back(aPrefix + STR_LAYOUT_TITLE); aNameList.push_back(aPrefix + STR_LAYOUT_SUBTITLE); diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 0cfc22087dbe..8f7430a8cdd2 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -674,12 +674,11 @@ void SdStyleSheet::throwIfDisposed() SdStyleSheet* SdStyleSheet::CreateEmptyUserStyle( SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily ) { - OUString aPrefix( "user" ); OUString aName; sal_Int32 nIndex = 1; do { - aName = aPrefix + OUString::number( nIndex++ ); + aName = "user" + OUString::number( nIndex++ ); } while( rPool.Find( aName, eFamily ) != nullptr ); diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 4e13e21646a2..5cb6a87a518f 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -759,8 +759,8 @@ bool PPTWriter::ImplCreateDocument() if ( mXPropSet.is() ) { OUString aCustomShow; - sal_uInt32 nPenColor = 0x1000000; - sal_Int32 nRestartTime = 0x7fffffff; + sal_uInt32 const nPenColor = 0x1000000; + sal_Int32 const nRestartTime = 0x7fffffff; sal_Int16 nStartSlide = 0; sal_Int16 nEndSlide = 0; sal_uInt32 nFlags = 0; // Bit 0: Auto advance @@ -943,7 +943,7 @@ void PPTWriter::ImplCreateHyperBlob( SvMemoryStream& rStrm ) sal_Int32 nUrlLen = pIter->aURL.getLength(); const OUString& rUrl = pIter->aURL; - sal_uInt32 nInfo = 7; + sal_uInt32 const nInfo = 7; rStrm .WriteUInt32( 3 ) // Type VT_I4 .WriteUInt32( nInfo ); // Info @@ -1261,13 +1261,12 @@ void PPTWriter::ImplWriteOLE( ) aOleExport.ExportOLEObject( xObj, *xTempStorage ); //TODO/MBA: testing - OUString aPersistStream( SVEXT_PERSIST_STREAM ); SvMemoryStream aStream; tools::SvRef<SotStorage> xCleanStorage( new SotStorage( false, aStream ) ); xTempStorage->CopyTo( xCleanStorage.get() ); // create a dummy content stream, the dummy content is necessary for ppt, but not for // doc files, so we can't share code. - tools::SvRef<SotStorageStream> xStm = xCleanStorage->OpenSotStream( aPersistStream ); + tools::SvRef<SotStorageStream> xStm = xCleanStorage->OpenSotStream( SVEXT_PERSIST_STREAM ); xStm->WriteUInt32( 0 ) // no ClipboardId .WriteUInt32( 4 ) // no target device .WriteUInt32( 1 ) // aspect ratio diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index fb33823500dc..d087e82397ae 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -171,8 +171,8 @@ sal_uInt32 PPTWriter::ImplSlideViewInfoContainer( sal_uInt32 nInstance, SvStream if ( pStrm ) { sal_uInt8 bShowGuides = 0; - sal_uInt8 bSnapToGrid = 1; - sal_uInt8 bSnapToShape = 0; + sal_uInt8 const bSnapToGrid = 1; + sal_uInt8 const bSnapToShape = 0; sal_Int32 nScaling = 85; sal_Int32 nMasterCoordinate = 0xdda; @@ -477,8 +477,8 @@ bool PPTWriter::ImplCloseDocument() mpStrm->WriteUInt16( nUniCode ); } sal_uInt8 lfCharSet = ANSI_CHARSET; - sal_uInt8 lfClipPrecision = 0; - sal_uInt8 lfQuality = 6; + sal_uInt8 const lfClipPrecision = 0; + sal_uInt8 const lfQuality = 6; sal_uInt8 lfPitchAndFamily = 0; if ( pDesc->CharSet == RTL_TEXTENCODING_SYMBOL ) @@ -1382,9 +1382,9 @@ void PPTWriter::ImplWriteClickAction( SvStream& rSt, css::presentation::ClickAct sal_uInt32 nSoundRef = 0; // a reference to a sound in the sound collection, or NULL. sal_uInt32 nHyperLinkID = 0;// a persistent unique identifier to an external hyperlink object (only valid when action == HyperlinkAction). sal_uInt8 nAction = 0; // Action See Action Table - sal_uInt8 nOleVerb = 0; // OleVerb Only valid when action == OLEAction. OLE verb to use, 0 = first verb, 1 = second verb, etc. + sal_uInt8 const nOleVerb = 0; // OleVerb Only valid when action == OLEAction. OLE verb to use, 0 = first verb, 1 = second verb, etc. sal_uInt8 nJump = 0; // Jump See Jump Table - sal_uInt8 nFlags = 0; // Bit 1: Animated. If 1, then button is animated + sal_uInt8 const nFlags = 0; // Bit 1: Animated. If 1, then button is animated // Bit 2: Stop sound. If 1, then stop current sound when button is pressed. // Bit 3: CustomShowReturn. If 1, and this is a jump to custom show, then return to this slide after custom show. sal_uInt8 nHyperLinkType = 0;// HyperlinkType a value from the LinkTo enum, such as LT_URL (only valid when action == HyperlinkAction). @@ -1637,12 +1637,12 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187) // sal_uInt32 nGroupLevel = 0; - sal_uInt32 nInstance, nGroups, nShapes, nShapeCount, nPer, nLastPer, nIndices, nOlePictureId; + sal_uInt32 nGroups, nShapes, nShapeCount, nPer, nLastPer, nIndices, nOlePictureId; css::awt::Point aTextRefPoint; ResetGroupTable( nShapes = mXShapes->getCount() ); - nIndices = nInstance = nLastPer = nShapeCount = 0; + nIndices = nLastPer = nShapeCount = 0; bool bIsTitlePossible = true; // powerpoint is not able to handle more than one title @@ -2017,7 +2017,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a nOlePictureId = mnExEmbed; mpPptEscherEx->OpenContainer( ESCHER_SpContainer ); - sal_uInt32 nSpFlags = SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_OLESHAPE; + sal_uInt32 const nSpFlags = SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_OLESHAPE; ImplCreateShape( ESCHER_ShpInst_HostControl, nSpFlags, aSolverContainer ); if ( aPropOpt.CreateGraphicProperties( mXPropSet, "MetaFile", false ) ) aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 ); @@ -3308,7 +3308,7 @@ void TextObjBinary::WriteTextSpecInfo( SvStream* pStrm ) { const PortionObj& rPortion = *(*it).get(); sal_Int32 nPortionSize = rPortion.mnTextSize >= nCharactersLeft ? nCharactersLeft : rPortion.mnTextSize; - sal_Int32 nFlags = 7; + sal_Int32 const nFlags = 7; nCharactersLeft -= nPortionSize; pStrm ->WriteUInt32( nPortionSize ) .WriteInt32( nFlags ) diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx index 35157a49cedb..09f0c8b6bf33 100644 --- a/sd/source/filter/eppt/pptexanimations.cxx +++ b/sd/source/filter/eppt/pptexanimations.cxx @@ -684,11 +684,11 @@ void AnimationExporter::exportNode( SvStream& rStrm, Reference< XAnimationNode > } EscherExContainer aAnimateTargetElement( rStrm, DFF_msofbtAnimateTargetElement ); { - sal_uInt32 nRefMode = 3; - sal_uInt32 nRefType = 2; + sal_uInt32 const nRefMode = 3; + sal_uInt32 const nRefType = 2; sal_uInt32 nRefId = mrExSoundCollection.GetId( aURL ); - sal_Int32 begin = -1; - sal_Int32 end = -1; + sal_Int32 const begin = -1; + sal_Int32 const end = -1; EscherExAtom aAnimReference( rStrm, DFF_msofbtAnimReference ); rStrm.WriteUInt32( nRefMode ).WriteUInt32( nRefType ).WriteUInt32( nRefId ).WriteInt32( begin ).WriteInt32( end ); @@ -1183,8 +1183,7 @@ bool AnimationExporter::exportAnimProperty( SvStream& rStrm, const sal_uInt16 nP void AnimationExporter::exportAnimPropertyString( SvStream& rStrm, const sal_uInt16 nPropertyId, const OUString& rVal, const TranslateMode eTranslateMode ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimAttributeValue, nPropertyId ); - sal_uInt8 nType = DFF_ANIM_PROP_TYPE_UNISTRING; - rStrm.WriteUChar( nType ); + rStrm.WriteUChar( DFF_ANIM_PROP_TYPE_UNISTRING ); OUString aStr( rVal ); if ( eTranslateMode != TRANSLATE_NONE ) ImplTranslateAttribute( aStr, eTranslateMode ); @@ -1194,25 +1193,22 @@ void AnimationExporter::exportAnimPropertyString( SvStream& rStrm, const sal_uIn void AnimationExporter::exportAnimPropertyFloat( SvStream& rStrm, const sal_uInt16 nPropertyId, const double& rVal ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimAttributeValue, nPropertyId ); - sal_uInt8 nType = DFF_ANIM_PROP_TYPE_FLOAT; float fFloat = (float)rVal; - rStrm.WriteUChar( nType ) + rStrm.WriteUChar( DFF_ANIM_PROP_TYPE_FLOAT ) .WriteFloat( fFloat ); } void AnimationExporter::exportAnimPropertyuInt32( SvStream& rStrm, const sal_uInt16 nPropertyId, const sal_uInt32 nVal, const TranslateMode ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimAttributeValue, nPropertyId ); - sal_uInt8 nType = DFF_ANIM_PROP_TYPE_INT32 ; - rStrm.WriteUChar( nType ) + rStrm.WriteUChar( DFF_ANIM_PROP_TYPE_INT32 ) .WriteUInt32( nVal ); } void AnimationExporter::exportAnimPropertyByte( SvStream& rStrm, const sal_uInt16 nPropertyId, const sal_uInt8 nVal ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimAttributeValue, nPropertyId ); - sal_uInt8 nType = DFF_ANIM_PROP_TYPE_BYTE; - rStrm.WriteUChar( nType ) + rStrm.WriteUChar( DFF_ANIM_PROP_TYPE_BYTE ) .WriteUChar( nVal ); } @@ -1228,11 +1224,11 @@ void AnimationExporter::exportAnimAction( SvStream& rStrm, const Reference< XAni { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimAction ); - sal_Int32 nConcurrent = 1; - sal_Int32 nNextAction = 1; + sal_Int32 const nConcurrent = 1; + sal_Int32 const nNextAction = 1; sal_Int32 nEndSync = 0; - sal_Int32 nU4 = 0; - sal_Int32 nU5 = 3; + sal_Int32 const nU4 = 0; + sal_Int32 const nU5 = 3; sal_Int16 nAnimationEndSync = 0; if ( xNode->getEndSync() >>= nAnimationEndSync ) @@ -1526,8 +1522,8 @@ void AnimationExporter::exportAnimateSet( SvStream& rStrm, const Reference< XAni EscherExContainer aAnimateSet( rStrm, DFF_msofbtAnimateSet, 0 ); { EscherExAtom aAnimateSetData( rStrm, DFF_msofbtAnimateSetData ); - sal_uInt32 nId1 = 1; // ?? - sal_uInt32 nId2 = 1; // ?? + sal_uInt32 const nId1 = 1; // ?? + sal_uInt32 const nId2 = 1; // ?? rStrm.WriteUInt32( nId1 ).WriteUInt32( nId2 ); } Any aConvertedValue( convertAnimateValue( xSet->getTo(), xSet->getAttributeName() ) ); @@ -1643,7 +1639,7 @@ void AnimationExporter::exportAnimateTarget( SvStream& rStrm, const Reference< X sal_uInt32 nBits = 0; sal_uInt32 nAdditive = 0; sal_uInt32 nAccumulate = 0; - sal_uInt32 nTransformType = 0; + sal_uInt32 const nTransformType = 0; if ( xAnimate.is() ) { if ( !xAnimate->getAttributeName().isEmpty() ) @@ -1775,7 +1771,7 @@ void AnimationExporter::exportAnimateTargetElement( SvStream& rStrm, const Any& { EscherExAtom aAnimReference( rStrm, DFF_msofbtAnimReference ); - sal_uInt32 nRefType = 1; // TODO: nRefType == 2 -> Sound; + sal_uInt32 const nRefType = 1; // TODO: nRefType == 2 -> Sound; sal_uInt32 nRefId = mrSolverContainer.GetShapeId( xShape ); rStrm.WriteUInt32( nRefMode ) @@ -1851,7 +1847,7 @@ void AnimationExporter::exportAnimValue( SvStream& rStrm, const Reference< XAnim if ( fRepeatCount != 0.0 ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimValue ); - sal_uInt32 nType = 0; + sal_uInt32 const nType = 0; rStrm.WriteUInt32( nType ) .WriteFloat( fRepeatCount ); } @@ -1860,7 +1856,7 @@ void AnimationExporter::exportAnimValue( SvStream& rStrm, const Reference< XAnim if ( bExportAlways || ( fAccelerate != 0.0 ) ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimValue ); - sal_uInt32 nType = 3; + sal_uInt32 const nType = 3; rStrm.WriteUInt32( nType ) .WriteFloat( fAccelerate ); } @@ -1870,7 +1866,7 @@ void AnimationExporter::exportAnimValue( SvStream& rStrm, const Reference< XAnim if ( bExportAlways || ( fDecelerate != 0.0 ) ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimValue ); - sal_uInt32 nType = 4; + sal_uInt32 const nType = 4; rStrm.WriteUInt32( nType ) .WriteFloat( fDecelerate ); } @@ -1880,7 +1876,7 @@ void AnimationExporter::exportAnimValue( SvStream& rStrm, const Reference< XAnim if ( bExportAlways || bAutoReverse ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimValue ); - sal_uInt32 nType = 5; + sal_uInt32 const nType = 5; sal_uInt32 nVal = bAutoReverse ? 1 : 0; rStrm.WriteUInt32( nType ) .WriteUInt32( nVal ); @@ -1895,8 +1891,8 @@ void AnimationExporter::exportTransitionFilter( SvStream& rStrm, const Reference EscherExContainer aAnimateFilter( rStrm, DFF_msofbtAnimateFilter ); { EscherExAtom aAnimateFilterData( rStrm, DFF_msofbtAnimateFilterData ); - sal_uInt32 nBits = 3; // bit 0 -> use AnimAttributeValue - // bit 1 -> use nTransition + sal_uInt32 const nBits = 3; // bit 0 -> use AnimAttributeValue + // bit 1 -> use nTransition sal_uInt32 nTransition = xFilter->getMode() ? 0 : 1; rStrm.WriteUInt32( nBits ) @@ -1921,14 +1917,14 @@ void AnimationExporter::exportAnimateMotion( SvStream& rStrm, const Reference< X { { //SJ: Ignored from import filter EscherExAtom aAnimateMotionData( rStrm, DFF_msofbtAnimateMotionData ); - sal_uInt32 nBits = 0x98; - sal_uInt32 nOrigin = 0x2; - float fByX = 100.0; // nBits&1 - float fByY = 100.0; // nBits&1 - float fFromX = 0.0; // nBits&2 - float fFromY = 0.0; // nBits&2 - float fToX = 100.0; // nBits&4 - float fToY = 100.0; // nBits&4 + sal_uInt32 const nBits = 0x98; + sal_uInt32 const nOrigin = 0x2; + float const fByX = 100.0; // nBits&1 + float const fByY = 100.0; // nBits&1 + float const fFromX = 0.0; // nBits&2 + float const fFromY = 0.0; // nBits&2 + float const fToX = 100.0; // nBits&4 + float const fToY = 100.0; // nBits&4 rStrm.WriteUInt32( nBits ).WriteFloat( fByX ).WriteFloat( fByY ).WriteFloat( fFromX ).WriteFloat( fFromY ).WriteFloat( fToX ).WriteFloat( fToY ).WriteUInt32( nOrigin ); } @@ -1954,7 +1950,7 @@ void AnimationExporter::exportAnimateTransform( SvStream& rStrm, const Reference { EscherExAtom aAnimateScaleData( rStrm, DFF_msofbtAnimateScaleData ); sal_uInt32 nBits = 0; - sal_uInt32 nZoomContents = 1; + sal_uInt32 const nZoomContents = 1; float fByX = 100.0; float fByY = 100.0; float fFromX = 0.0; @@ -2006,7 +2002,7 @@ void AnimationExporter::exportAnimateTransform( SvStream& rStrm, const Reference { EscherExAtom aAnimateRotationData( rStrm, DFF_msofbtAnimateRotationData ); sal_uInt32 nBits = 0; - sal_uInt32 nU1 = 0; + sal_uInt32 const nU1 = 0; float fBy = 360.0; float fFrom = 0.0; float fTo = 360.0; @@ -2118,9 +2114,9 @@ void AnimationExporter::exportIterate( SvStream& rStrm, const Reference< XAnimat float fInterval = 10.0; sal_Int32 nTextUnitEffect = 0; - sal_Int32 nU1 = 1; - sal_Int32 nU2 = 1; - sal_Int32 nU3 = 0xe; + sal_Int32 const nU1 = 1; + sal_Int32 const nU2 = 1; + sal_Int32 const nU3 = 0xe; sal_Int16 nIterateType = xIterate->getIterateType(); switch( nIterateType ) diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 227291fb9dcc..e0691464bee1 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -369,10 +369,9 @@ bool PowerPointExport::exportDocument() mXStatusIndicator.set( getStatusIndicator(), UNO_QUERY ); - OUString sBaseURI( "BaseURI"); std::vector< PropertyValue > aProperties; PropertyValue aProperty; - aProperty.Name = sBaseURI; + aProperty.Name = "BaseURI"; aProperty.Value <<= getFileUrl(); aProperties.push_back( aProperty ); @@ -1849,12 +1848,11 @@ void PowerPointExport::WriteShapeTree( const FSHelperPtr& pFS, PageType ePageTyp aDML.SetMaster( bMaster ); aDML.SetPageType( ePageType ); aDML.SetBackgroundDark(mbIsBackgroundDark); - sal_uInt32 nShapes; pFS->startElementNS( XML_p, XML_spTree, FSEND ); pFS->write( MAIN_GROUP ); - ResetGroupTable( nShapes = mXShapes->getCount() ); + ResetGroupTable( mXShapes->getCount() ); while( GetNextGroupEntry() ) { diff --git a/sd/source/filter/eppt/pptx-stylesheet.cxx b/sd/source/filter/eppt/pptx-stylesheet.cxx index 6a739344dd40..b4be91a71810 100644 --- a/sd/source/filter/eppt/pptx-stylesheet.cxx +++ b/sd/source/filter/eppt/pptx-stylesheet.cxx @@ -471,7 +471,7 @@ void PPTExStyleSheet::WriteTxCFStyleAtom( SvStream& rSt ) { const PPTExCharLevel& rCharStyle = mpCharSheet[ EPP_TEXTTYPE_Other ]->maCharLevel[ 0 ]; - sal_uInt16 nFlags = 0x60 // ?? + sal_uInt16 const nFlags = 0x60 // ?? | 0x02 // fontsize; | 0x04; // fontcolor diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx index 5b5af603e3a5..e8813362b410 100644 --- a/sd/source/filter/grf/sdgrffilter.cxx +++ b/sd/source/filter/grf/sdgrffilter.cxx @@ -257,7 +257,6 @@ bool SdGRFFilter::Export() beans::PropertyValues aArgs; TransformItems( SID_SAVEASDOC, *pSet, aArgs ); - OUString sInteractionHandler( "InteractionHandler" ); OUString sFilterName( "FilterName" ); OUString sShortName( rGraphicFilter.GetExportFormatShortName( nFilter ) ); @@ -272,7 +271,7 @@ bool SdGRFFilter::Export() aArgs[ i ].Name = sFilterName; aArgs[ i ].Value <<= sShortName; } - else if ( rStr == sInteractionHandler ) + else if ( rStr == "InteractionHandler" ) { uno::Reference< task::XInteractionHandler > xHdl; if ( aArgs[ i ].Value >>= xHdl ) diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 141569cfd487..217c5cd4c2ec 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -1565,8 +1565,7 @@ bool SdPublishingDlg::Save() if( !pStream ) return false; - sal_uInt16 aCheck = nMagic; - pStream->WriteUInt16( aCheck ); + pStream->WriteUInt16( nMagic ); // Destroys the SdIOCompat before the Stream is being distributed { diff --git a/sd/source/filter/sdfilter.cxx b/sd/source/filter/sdfilter.cxx index 408fb9a97f3b..ae3fb3dccb33 100644 --- a/sd/source/filter/sdfilter.cxx +++ b/sd/source/filter/sdfilter.cxx @@ -55,8 +55,7 @@ SdFilter::~SdFilter() OUString SdFilter::ImplGetFullLibraryName( const OUString& rLibraryName ) { - OUString aTemp(SVLIBRARY("?")); - return aTemp.replaceFirst( "?", rLibraryName ); + return OUString(SVLIBRARY("?")).replaceFirst( "?", rLibraryName ); } #ifndef DISABLE_DYNLOADING diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 29313c60f32d..01cba586eb44 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -522,7 +522,6 @@ bool SdXMLFilter::Import( ErrCode& nError ) if(mxStatusIndicator.is()) { sal_Int32 nProgressRange(1000000); - sal_Int32 nProgressCurrent(0); OUString aMsg(SdResId(STR_LOAD_DOC)); mxStatusIndicator->start(aMsg, nProgressRange); @@ -533,7 +532,7 @@ bool SdXMLFilter::Import( ErrCode& nError ) // set ProgressCurrent uno::Any aProgCurrent; - aProgCurrent <<= nProgressCurrent; + aProgCurrent <<= sal_Int32(0); xInfoSet->setPropertyValue( "ProgressCurrent" , aProgCurrent); } } @@ -543,8 +542,7 @@ bool SdXMLFilter::Import( ErrCode& nError ) tools::SvRef<SotStorageStream> xDocStream; uno::Reference < embed::XStorage > xStorage = mrMedium.GetStorage(); - OUString sSourceStorage( "SourceStorage"); - xInfoSet->setPropertyValue( sSourceStorage, Any( xStorage ) ); + xInfoSet->setPropertyValue( "SourceStorage", Any( xStorage ) ); if( !xStorage.is() ) nRet = SD_XML_READERROR; @@ -827,9 +825,8 @@ bool SdXMLFilter::Export() uno::Reference< beans::XPropertySet > xInfoSet( GenericPropertySet_CreateInstance( new PropertySetInfo( aExportInfoMap ) ) ); SvtSaveOptions aSaveOpt; - OUString sUsePrettyPrinting("UsePrettyPrinting"); bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() ); - xInfoSet->setPropertyValue( sUsePrettyPrinting, makeAny( bUsePrettyPrinting ) ); + xInfoSet->setPropertyValue( "UsePrettyPrinting", makeAny( bUsePrettyPrinting ) ); const uno::Reference < embed::XStorage >& xStorage = mrMedium.GetOutputStorage(); @@ -837,8 +834,7 @@ bool SdXMLFilter::Export() OUString sPropName( "BaseURI" ); xInfoSet->setPropertyValue( sPropName, makeAny( mrMedium.GetBaseURL( true ) ) ); - OUString sTargetStorage( "TargetStorage" ); - xInfoSet->setPropertyValue( sTargetStorage, Any( xStorage ) ); + xInfoSet->setPropertyValue( "TargetStorage", Any( xStorage ) ); if( SfxObjectCreateMode::EMBEDDED == mrDocShell.GetCreateMode() ) { @@ -883,7 +879,6 @@ bool SdXMLFilter::Export() if(mxStatusIndicator.is()) { sal_Int32 nProgressRange(1000000); - sal_Int32 nProgressCurrent(0); OUString aMsg(SdResId(STR_SAVE_DOC)); mxStatusIndicator->start(aMsg, nProgressRange); @@ -894,7 +889,7 @@ bool SdXMLFilter::Export() // set ProgressCurrent uno::Any aProgCurrent; - aProgCurrent <<= nProgressCurrent; + aProgCurrent <<= sal_Int32(0); xInfoSet->setPropertyValue( "ProgressCurrent" , aProgCurrent); } diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index a871239e64a7..90301c946242 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -367,8 +367,6 @@ MotionPathTag::~MotionPathTag() void MotionPathTag::updatePathAttributes() { - OUString aEmpty( "?" ); - ::basegfx::B2DPolygon aCandidate; if( mxPolyPoly.count() ) { @@ -383,7 +381,7 @@ void MotionPathTag::updatePathAttributes() aEndArrow.append(::basegfx::B2DPoint(0.0, 30.0)); aEndArrow.append(::basegfx::B2DPoint(20.0, 30.0)); aEndArrow.setClosed(true); - mpPathObj->SetMergedItem(XLineEndItem(aEmpty,::basegfx::B2DPolyPolygon(aEndArrow))); + mpPathObj->SetMergedItem(XLineEndItem("?",::basegfx::B2DPolyPolygon(aEndArrow))); mpPathObj->SetMergedItem(XLineEndWidthItem(400)); mpPathObj->SetMergedItem(XLineEndCenterItem(true)); } diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index 9006600efde4..00fddda8a313 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -432,14 +432,12 @@ sal_uLong AnnotationTag::GetMarkedPointCount() const bool AnnotationTag::MarkPoint(SdrHdl& /*rHdl*/, bool /*bUnmark*/ ) { - bool bRet=false; - return bRet; + return false; } bool AnnotationTag::MarkPoints(const ::tools::Rectangle* /*pRect*/, bool /*bUnmark*/ ) { - bool bChgd=false; - return bChgd; + return false; } bool AnnotationTag::getContext( SdrViewContext& /*rContext*/ ) diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index edc4be63b315..a1481e44a36b 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -128,12 +128,11 @@ sal_Int8 LayerTabBar::AcceptDrop( const AcceptDropEvent& rEvt ) if( !pDrViewSh->GetDocSh()->IsReadOnly() ) { - sal_uInt16 nPageId = SDRPAGE_NOTFOUND; Point aPos( PixelToLogic( rEvt.maPosPixel ) ); SdrLayerID nLayerId = pDrViewSh->GetView()->GetDoc().GetLayerAdmin().GetLayerID( GetPageText( GetPageId( aPos ) ) ); - nRet = pDrViewSh->AcceptDrop( rEvt, *this, nullptr, nPageId, nLayerId ); + nRet = pDrViewSh->AcceptDrop( rEvt, *this, nullptr, SDRPAGE_NOTFOUND, nLayerId ); SwitchPage( aPos ); } @@ -146,10 +145,9 @@ sal_Int8 LayerTabBar::AcceptDrop( const AcceptDropEvent& rEvt ) */ sal_Int8 LayerTabBar::ExecuteDrop( const ExecuteDropEvent& rEvt ) { - sal_uInt16 nPageId = SDRPAGE_NOTFOUND; SdrLayerID nLayerId = pDrViewSh->GetView()->GetDoc().GetLayerAdmin().GetLayerID( GetPageText( GetPageId( PixelToLogic( rEvt.maPosPixel ) ) ) ); - sal_Int8 nRet = pDrViewSh->ExecuteDrop( rEvt, *this, nullptr, nPageId, nLayerId ); + sal_Int8 nRet = pDrViewSh->ExecuteDrop( rEvt, *this, nullptr, SDRPAGE_NOTFOUND, nLayerId ); EndSwitchPage(); diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index 3cb531eed408..9bd976062663 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -644,11 +644,9 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl, ListBox&, void) Bitmap aBmp = aGraphic.GetBitmap(); sal_Int32 nBmpWidth = aBmp.GetSizePixel().Width(); sal_Int32 nBmpHeight = aBmp.GetSizePixel().Height(); - sal_Int32 nPrevWidth = 200; - sal_Int32 nPrewHeight = 150; - double nXRatio = (double) nPrevWidth / nBmpWidth; - double nYRatio = (double) nPrewHeight / nBmpHeight; + double nXRatio = (double) 200 / nBmpWidth; + double nYRatio = (double) 150 / nBmpHeight; if ( nXRatio < nYRatio ) aBmp.Scale( nXRatio, nXRatio ); else diff --git a/sd/source/ui/dlg/TemplateScanner.cxx b/sd/source/ui/dlg/TemplateScanner.cxx index 502cdee563c8..4071cc1a023e 100644 --- a/sd/source/ui/dlg/TemplateScanner.cxx +++ b/sd/source/ui/dlg/TemplateScanner.cxx @@ -177,13 +177,11 @@ TemplateScanner::~TemplateScanner() TemplateScanner::State TemplateScanner::GetTemplateRoot() { - State eNextState (INITIALIZE_FOLDER_SCANNING); - Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference<frame::XDocumentTemplates> xTemplates = frame::DocumentTemplates::create(xContext); mxTemplateRoot = xTemplates->getContent(); - return eNextState; + return INITIALIZE_FOLDER_SCANNING; } TemplateScanner::State TemplateScanner::InitializeEntryScanning() @@ -202,8 +200,7 @@ TemplateScanner::State TemplateScanner::InitializeEntryScanning() aProps[2] = "TypeDescription"; // Create a cursor to iterate over the templates in this folders. - ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_DOCUMENTS_ONLY; - mxEntryResultSet.set( maFolderContent.createCursor(aProps, eInclude)); + mxEntryResultSet.set( maFolderContent.createCursor(aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY)); } else eNextState = ERROR; @@ -290,8 +287,7 @@ TemplateScanner::State TemplateScanner::InitializeFolderScanning() aProps[1] = "TargetDirURL"; // Create an cursor to iterate over the template folders. - ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_ONLY; - mxFolderResultSet.set( aTemplateDir.createCursor(aProps, eInclude)); + mxFolderResultSet.set( aTemplateDir.createCursor(aProps, ::ucbhelper::INCLUDE_FOLDERS_ONLY)); if (mxFolderResultSet.is()) eNextState = GATHER_FOLDER_LIST; } diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 9ab74aba8f0b..250bdee0c546 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -289,7 +289,7 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, Button *, p, void ) bDisableCtrls = true; m_pBtnStop->Enable(); m_pBtnStop->Update(); - OUString aStr("Animator:"); // here we should think about something smart + OUString const aStr("Animator:"); // here we should think about something smart pProgress = new SfxProgress( nullptr, aStr, nFullTime ); } diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx index 77c39845a4e4..540ddbcf911b 100644 --- a/sd/source/ui/dlg/dlgolbul.cxx +++ b/sd/source/ui/dlg/dlgolbul.cxx @@ -97,8 +97,7 @@ OutlineBulletDlg::OutlineBulletDlg( if(bOutliner) { SfxStyleSheetBasePool* pSSPool = pView->GetDocSh()->GetStyleSheetPool(); - OUString aStyleName(STR_LAYOUT_OUTLINE " 1"); - SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( aStyleName, SD_STYLE_FAMILY_PSEUDO); + SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( STR_LAYOUT_OUTLINE " 1", SD_STYLE_FAMILY_PSEUDO); if( pFirstStyleSheet ) pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, false, reinterpret_cast<const SfxPoolItem**>(&pItem)); } diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 40575d52a566..dacf464abea1 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -579,14 +579,13 @@ bool DrawDocShell::SaveAs( SfxMedium& rMedium ) if( GetCreateMode() == SfxObjectCreateMode::STANDARD ) SfxObjectShell::SetVisArea( ::tools::Rectangle() ); - ErrCode nVBWarning = ERRCODE_NONE; - bool bRet = SfxObjectShell::SaveAs( rMedium ); + bool bRet = SfxObjectShell::SaveAs( rMedium ); if( bRet ) bRet = SdXMLFilter( rMedium, *this, SDXMLMODE_Normal, SotStorage::GetVersion( rMedium.GetStorage() ) ).Export(); if( GetError() == ERRCODE_NONE ) - SetError(nVBWarning); + SetError(ERRCODE_NONE); return bRet; } diff --git a/sd/source/ui/framework/factories/ViewShellWrapper.cxx b/sd/source/ui/framework/factories/ViewShellWrapper.cxx index 44113c264096..3d5f0bffc647 100644 --- a/sd/source/ui/framework/factories/ViewShellWrapper.cxx +++ b/sd/source/ui/framework/factories/ViewShellWrapper.cxx @@ -118,8 +118,6 @@ sal_Bool SAL_CALL ViewShellWrapper::select( const css::uno::Any& aSelection ) if (!mpSlideSorterViewShell) return false; - bool bOk = true; - ::sd::slidesorter::controller::SlideSorterController& rSlideSorterController = mpSlideSorterViewShell->GetSlideSorter().GetController(); ::sd::slidesorter::controller::PageSelector& rSelector (rSlideSorterController.GetPageSelector()); @@ -146,7 +144,7 @@ sal_Bool SAL_CALL ViewShellWrapper::select( const css::uno::Any& aSelection ) } } - return bOk; + return true; } uno::Any SAL_CALL ViewShellWrapper::getSelection() diff --git a/sd/source/ui/func/bulmaper.cxx b/sd/source/ui/func/bulmaper.cxx index 3f9615a22bae..b4f991ff7c48 100644 --- a/sd/source/ui/func/bulmaper.cxx +++ b/sd/source/ui/func/bulmaper.cxx @@ -57,29 +57,25 @@ void SdBulletMapper::MapFontsInNumRule( SvxNumRule& aNumRule, const SfxItemSet& // if enumeration instead bullet is chosen, adjust bullet font to template font // to be implemented if module supports CJK - long nFontID = SID_ATTR_CHAR_FONT; - long nFontHeightID = SID_ATTR_CHAR_FONTHEIGHT; - long nWeightID = SID_ATTR_CHAR_WEIGHT; - long nPostureID = SID_ATTR_CHAR_POSTURE; vcl::Font aMyFont; const SvxFontItem& rFItem = - static_cast<const SvxFontItem&>(rSet.Get(GetWhich( (sal_uInt16)nFontID ))); + static_cast<const SvxFontItem&>(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_FONT ))); aMyFont.SetFamily(rFItem.GetFamily()); aMyFont.SetFamilyName(rFItem.GetFamilyName()); aMyFont.SetCharSet(rFItem.GetCharSet()); aMyFont.SetPitch(rFItem.GetPitch()); const SvxFontHeightItem& rFHItem = - static_cast<const SvxFontHeightItem&>(rSet.Get(GetWhich( (sal_uInt16)nFontHeightID ))); + static_cast<const SvxFontHeightItem&>(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_FONTHEIGHT ))); aMyFont.SetFontSize(Size(0, rFHItem.GetHeight())); const SvxWeightItem& rWItem = - static_cast<const SvxWeightItem&>(rSet.Get(GetWhich( (sal_uInt16)nWeightID ))); + static_cast<const SvxWeightItem&>(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_WEIGHT ))); aMyFont.SetWeight(rWItem.GetWeight()); const SvxPostureItem& rPItem = - static_cast<const SvxPostureItem&>(rSet.Get(GetWhich( (sal_uInt16)nPostureID ))); + static_cast<const SvxPostureItem&>(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_POSTURE ))); aMyFont.SetItalic(rPItem.GetPosture()); const SvxUnderlineItem& rUItem = static_cast<const SvxUnderlineItem&>(rSet.Get(GetWhich(SID_ATTR_CHAR_UNDERLINE))); diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx index acb4ea7fbbd5..a44b2f6f4a97 100644 --- a/sd/source/ui/func/fuformatpaintbrush.cxx +++ b/sd/source/ui/func/fuformatpaintbrush.cxx @@ -136,8 +136,7 @@ bool FuFormatPaintBrush::MouseButtonDown(const MouseEvent& rMEvt) if( aVEvt.pObj ) { sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() ); - bool bToggle = false; - mpView->MarkObj(mpWindow->PixelToLogic( rMEvt.GetPosPixel() ), nHitLog, bToggle); + mpView->MarkObj(mpWindow->PixelToLogic( rMEvt.GetPosPixel() ), nHitLog, false/*bToggle*/); return true; } } diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 711aa064351a..b4c2787c8f12 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -386,11 +386,10 @@ bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium) necessary. bNameOK is sal_False if the user has canceled. */ bNameOK = mpView->GetExchangeList( aExchangeList, aBookmarkList, 0 ); - bool bReplace = false; if( bNameOK ) bOK = mpDoc->InsertBookmarkAsPage( aBookmarkList, &aExchangeList, - bLink, bReplace, nPos, + bLink, false/*bReplace*/, nPos, false, nullptr, true, true, false ); aBookmarkList.clear(); diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index a9b36dcd63c3..f171a22cc1ec 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -335,8 +335,7 @@ const SfxPoolItem* FuOutlineBullet::GetNumBulletItem(SfxItemSet& aNewAttr, sal_u if(bOutliner) { SfxStyleSheetBasePool* pSSPool = mpView->GetDocSh()->GetStyleSheetPool(); - OUString aStyleName(STR_LAYOUT_OUTLINE " 1"); - SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( aStyleName, SD_STYLE_FAMILY_PSEUDO); + SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( STR_LAYOUT_OUTLINE " 1", SD_STYLE_FAMILY_PSEUDO); if( pFirstStyleSheet ) pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, false, reinterpret_cast<const SfxPoolItem**>(&pItem)); } diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx index ba72af5aab2c..169dd4f237f3 100644 --- a/sd/source/ui/func/fuprobjs.cxx +++ b/sd/source/ui/func/fuprobjs.cxx @@ -114,9 +114,7 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) if( bUnique ) { - OUString aStyleName = aLayoutName; - aStyleName += SD_LT_SEPARATOR ; - sal_uInt16 nDlgId = TAB_PRES_LAYOUT_TEMPLATE; + OUString aStyleName = aLayoutName + SD_LT_SEPARATOR; PresentationObjects ePO; if( bPage ) @@ -140,17 +138,21 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) SfxStyleSheetBase& rStyleSheet = *pStyleSheet; SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, mpViewShell->GetActiveWindow(), nDlgId, rStyleSheet, ePO, pStyleSheetPool ) : nullptr); - if( pDlg && (pDlg->Execute() == RET_OK) ) + if (pFact) { - const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); - // Undo-Action - StyleSheetUndoAction* pAction = new StyleSheetUndoAction - (mpDoc, static_cast<SfxStyleSheet*>(pStyleSheet), pOutSet); - mpDocSh->GetUndoManager()->AddUndoAction(pAction); - - pStyleSheet->GetItemSet().Put( *pOutSet ); - static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxHint( SfxHintId::DataChanged ) ); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, mpViewShell->GetActiveWindow(), + TAB_PRES_LAYOUT_TEMPLATE, rStyleSheet, ePO, pStyleSheetPool )); + if( pDlg->Execute() == RET_OK ) + { + const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); + // Undo-Action + StyleSheetUndoAction* pAction = new StyleSheetUndoAction + (mpDoc, static_cast<SfxStyleSheet*>(pStyleSheet), pOutSet); + mpDocSh->GetUndoManager()->AddUndoAction(pAction); + + pStyleSheet->GetItemSet().Put( *pOutSet ); + static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxHint( SfxHintId::DataChanged ) ); + } } } } diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 9262929aabba..326f7228bd56 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -532,8 +532,7 @@ void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj) { // FitToSize (fit to frame) SfxItemSet aSet(mpViewShell->GetPool(), svl::Items<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH>{}); - SdrFitToSizeType eFTS = SdrFitToSizeType::Proportional; - aSet.Put(SdrTextFitToSizeTypeItem(eFTS)); + aSet.Put(SdrTextFitToSizeTypeItem(SdrFitToSizeType::Proportional)); aSet.Put(makeSdrTextAutoGrowHeightItem(false)); aSet.Put(makeSdrTextAutoGrowWidthItem(false)); pTxtObj->SetMergedItemSet(aSet); @@ -544,8 +543,7 @@ void FuText::ImpSetAttributesFitToSizeVertical(SdrTextObj* pTxtObj) { SfxItemSet aSet(mpViewShell->GetPool(), svl::Items<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH>{}); - SdrFitToSizeType eFTS = SdrFitToSizeType::Proportional; - aSet.Put(SdrTextFitToSizeTypeItem(eFTS)); + aSet.Put(SdrTextFitToSizeTypeItem(SdrFitToSizeType::Proportional)); aSet.Put(makeSdrTextAutoGrowHeightItem(false)); aSet.Put(makeSdrTextAutoGrowWidthItem(false)); pTxtObj->SetMergedItemSet(aSet); diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index c5ad4e20d18c..2b01b046d381 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -888,7 +888,6 @@ DBusHandlerResult ProfileMessageFunction (DBusConnection *pConnection, DBusMessage *pMessage, void *user_data) { SAL_INFO("sdremote.bluetooth", "ProfileMessageFunction||" << dbus_message_get_interface(pMessage) << "||" << dbus_message_get_member(pMessage)); - DBusHandlerResult aRet = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; if (OString(dbus_message_get_interface(pMessage)).equals("org.bluez.Profile1")) { @@ -953,7 +952,7 @@ DBusHandlerResult ProfileMessageFunction } } SAL_WARN("sdremote.bluetooth", "Couldn't handle message correctly."); - return aRet; + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } diff --git a/sd/source/ui/remotecontrol/Receiver.cxx b/sd/source/ui/remotecontrol/Receiver.cxx index 9d24a6cf006b..3fd6d9a1a9fe 100644 --- a/sd/source/ui/remotecontrol/Receiver.cxx +++ b/sd/source/ui/remotecontrol/Receiver.cxx @@ -113,7 +113,6 @@ void Receiver::executeCommand( const std::vector<OString> &aCommand ) } else if ( aCommand[0].equals( "presentation_blank_screen" ) ) { - sal_Int32 aColour = 0; // Default is black if ( aCommand.size() > 1 ) { // aColour = FIXME: get the colour in some format from this string @@ -121,7 +120,7 @@ void Receiver::executeCommand( const std::vector<OString> &aCommand ) } if ( xSlideShowController.is() ) { - xSlideShowController->blankScreen( aColour ); + xSlideShowController->blankScreen( 0 ); // Default is black } } else if (aCommand[0].equals( "pointer_started" )) diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index 5deddae4e7f6..e905b85254bd 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -848,8 +848,7 @@ Reference<frame::XModel> MasterPageContainer::Implementation::GetModel() xSlideSupplier->getDrawPages(), uno::UNO_QUERY); if (xSlides.is()) { - sal_Int32 nIndex (0); - uno::Reference<drawing::XDrawPage> xNewPage (xSlides->insertNewByIndex(nIndex)); + uno::Reference<drawing::XDrawPage> xNewPage (xSlides->insertNewByIndex(0)); uno::Reference<beans::XPropertySet> xProperties(xNewPage, uno::UNO_QUERY); if (xProperties.is()) xProperties->setPropertyValue( diff --git a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx index c9a2e37b844e..64c84c27f339 100644 --- a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx +++ b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx @@ -177,8 +177,7 @@ SdPage* DefaultPageObjectProvider::operator () (SdDrawDocument* pContainerDocume SdPage* pLocalMasterPage = nullptr; if (pContainerDocument != nullptr) { - sal_Int32 nIndex (0); - SdPage* pLocalSlide = pContainerDocument->GetSdPage((sal_uInt16)nIndex, PageKind::Standard); + SdPage* pLocalSlide = pContainerDocument->GetSdPage(0, PageKind::Standard); if (pLocalSlide!=nullptr && pLocalSlide->TRG_HasMasterPage()) pLocalMasterPage = dynamic_cast<SdPage*>(&pLocalSlide->TRG_GetMasterPage()); } diff --git a/sd/source/ui/tools/IdleDetection.cxx b/sd/source/ui/tools/IdleDetection.cxx index b2e31e93270c..e2e7cb294fe8 100644 --- a/sd/source/ui/tools/IdleDetection.cxx +++ b/sd/source/ui/tools/IdleDetection.cxx @@ -53,11 +53,9 @@ IdleState IdleDetection::CheckSlideShowRunning() { IdleState eResult (IdleState::Idle); - bool bIsSlideShowShowing = false; - // Iterate over all view frames. for (SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst(); - pViewFrame!=nullptr && !bIsSlideShowShowing; + pViewFrame!=nullptr; pViewFrame = SfxViewFrame::GetNext(*pViewFrame)) { // Ignore the current frame when it does not exist, is not valid, or diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index 384b53dbbf0d..a7e88b811363 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -322,7 +322,7 @@ void PreviewRenderer::PaintSubstitutionText (const OUString& rSubstitutionText) Point(0,0), mpPreviewDevice->PixelToLogic( mpPreviewDevice->GetOutputSizePixel())); - DrawTextFlags nTextStyle = + DrawTextFlags const nTextStyle = DrawTextFlags::Center | DrawTextFlags::VCenter | DrawTextFlags::MultiLine diff --git a/sd/source/ui/unoidl/SdUnoSlideView.cxx b/sd/source/ui/unoidl/SdUnoSlideView.cxx index e5b172752526..c1f1f4bb0638 100644 --- a/sd/source/ui/unoidl/SdUnoSlideView.cxx +++ b/sd/source/ui/unoidl/SdUnoSlideView.cxx @@ -52,8 +52,6 @@ SdUnoSlideView::~SdUnoSlideView() throw() sal_Bool SAL_CALL SdUnoSlideView::select (const Any& aSelection) { - bool bOk = true; - slidesorter::controller::SlideSorterController& rSlideSorterController = mrSlideSorter.GetController(); slidesorter::controller::PageSelector& rSelector (rSlideSorterController.GetPageSelector()); @@ -80,7 +78,7 @@ sal_Bool SAL_CALL SdUnoSlideView::select (const Any& aSelection) } } - return bOk; + return true; } Any SAL_CALL SdUnoSlideView::getSelection() diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 930e496ef09b..6e98bf784369 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -542,8 +542,6 @@ sal_uInt16 ViewShellBase::SetPrinter ( pNewPrinter->SetMapMode(aMap); Size aNewSize = pNewPrinter->GetOutputSize(); - bool bScaleAll = false; - std::shared_ptr<DrawViewShell> pDrawViewShell ( std::dynamic_pointer_cast<DrawViewShell>(GetMainViewShell())); if (pDrawViewShell) @@ -554,7 +552,7 @@ sal_uInt16 ViewShellBase::SetPrinter ( pDrawViewShell->GetPageKind(), aNewSize, -1,-1,-1,-1, - bScaleAll, + false/*bScaleAll*/, pNewPrinter->GetOrientation(), pPage->GetPaperBin(), pPage->IsBackgroundFullSize()); @@ -863,8 +861,7 @@ OUString ViewShellBase::GetInitialViewShellType() if (xViewData->getCount() == 0) break; - sal_Int32 nView = 0; - css::uno::Any aAny = xViewData->getByIndex(nView); + css::uno::Any aAny = xViewData->getByIndex(0); Sequence<beans::PropertyValue> aProperties; if ( ! (aAny >>= aProperties)) break; diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index bcb39952be3e..d7b439d12169 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -263,9 +263,8 @@ void TextObjectBar::Execute( SfxRequest &rReq ) case SID_ATTR_PARA_LRSPACE: { - sal_uInt16 nSpaceSlot = SID_ATTR_PARA_LRSPACE; SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get( - GetPool().GetWhich(nSpaceSlot))); + GetPool().GetWhich(SID_ATTR_PARA_LRSPACE))); SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} ); aLRSpace.SetWhich( EE_PARA_LRSPACE ); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index fb5f5b31eb33..c960e4c4c7cb 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -322,8 +322,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { OSL_FAIL(" no value for hyphenation!"); SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE>{} ); - bool bValue = true; - aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) ); + aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, true ) ); mpDrawView->SetAttributes( aSet ); } rReq.Done(); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 8fd9640f62fe..2005b4770eb5 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -668,9 +668,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) case SID_ATTR_PARA_LINESPACE: if (pArgs) { - sal_uInt16 nSlot = SID_ATTR_PARA_LINESPACE; SvxLineSpacingItem aParaLineSP = static_cast<const SvxLineSpacingItem&>(pArgs->Get( - GetPool().GetWhich(nSlot))); + GetPool().GetWhich(SID_ATTR_PARA_LINESPACE))); SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_SBL, EE_PARA_SBL>{} ); aParaLineSP.SetWhich( EE_PARA_SBL ); @@ -728,9 +727,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) case SID_ATTR_PARA_ULSPACE: if (pArgs) { - sal_uInt16 nSlot = SID_ATTR_PARA_ULSPACE; SvxULSpaceItem aULSP = static_cast<const SvxULSpaceItem&>(pArgs->Get( - GetPool().GetWhich(nSlot))); + GetPool().GetWhich(SID_ATTR_PARA_ULSPACE))); SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_ULSPACE, EE_PARA_ULSPACE>{} ); aULSP.SetWhich( EE_PARA_ULSPACE ); @@ -743,9 +741,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) case SID_ATTR_PARA_LRSPACE: if (pArgs) { - sal_uInt16 nSlot = SID_ATTR_PARA_LRSPACE; SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get( - GetPool().GetWhich(nSlot))); + GetPool().GetWhich(SID_ATTR_PARA_LRSPACE))); SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} ); aLRSpace.SetWhich( EE_PARA_LRSPACE ); @@ -907,10 +904,9 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) rSet.Put( rItem ); const SvxLRSpaceItem& rLRSpaceItem = static_cast<const SvxLRSpaceItem&>( aEditAttr.Get( EE_PARA_LRSPACE ) ); - sal_uInt16 nId = SID_ATTR_PARA_LRSPACE; SvxLRSpaceItem aLRSpaceItem( rLRSpaceItem.GetLeft(), rLRSpaceItem.GetRight(), rLRSpaceItem.GetTextLeft(), - rLRSpaceItem.GetTextFirstLineOfst(), nId ); + rLRSpaceItem.GetTextFirstLineOfst(), SID_ATTR_PARA_LRSPACE ); const sal_Int16 nOutlineLevel = static_cast<const SfxInt16Item&>( aEditAttr.Get( EE_PARA_OUTLLEVEL )).GetValue(); const SvxNumBulletItem& rNumBulletItem = static_cast<const SvxNumBulletItem&>( aEditAttr.Get( EE_PARA_NUMBULLET ) ); diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 93f13c1839b1..32439b7abca9 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -244,8 +244,7 @@ void DrawViewShell::StartRulerDrag ( //else the corresponding entry is set false . void DrawViewShell::FreshNavigatrEntry() { - sal_uInt16 nId = SID_NAVIGATOR; - SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId ); + SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( SID_NAVIGATOR ); if( pWindow ) { SdNavigatorWin* pNavWin = static_cast<SdNavigatorWin*>( pWindow->GetContextWindow( SD_MOD() ) ); @@ -256,8 +255,7 @@ void DrawViewShell::FreshNavigatrEntry() void DrawViewShell::FreshNavigatrTree() { - sal_uInt16 nId = SID_NAVIGATOR; - SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId ); + SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( SID_NAVIGATOR ); if( pWindow ) { SdNavigatorWin* pNavWin = static_cast<SdNavigatorWin*>( pWindow->GetContextWindow( SD_MOD() ) ); diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index ddb72778bdac..4dbc8054ab66 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -225,8 +225,7 @@ void DrawViewShell::SetChildWindowState( SfxItemSet& rSet ) } if( SfxItemState::DEFAULT == rSet.GetItemState( SID_NAVIGATOR ) ) { - sal_uInt16 nId = SID_NAVIGATOR; - rSet.Put( SfxBoolItem( SID_NAVIGATOR, GetViewFrame()->HasChildWindow( nId ) ) ); + rSet.Put( SfxBoolItem( SID_NAVIGATOR, GetViewFrame()->HasChildWindow( SID_NAVIGATOR ) ) ); } if( SfxItemState::DEFAULT == rSet.GetItemState( SID_BMPMASK ) ) { diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 24d8cac6f277..9482c530f3bd 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -313,8 +313,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind) mbIsRulerDrag = false; - OUString aName( "DrawViewShell" ); - SetName (aName); + SetName ("DrawViewShell"); mnLockCount = 0UL; diff --git a/sd/source/ui/view/drviewsd.cxx b/sd/source/ui/view/drviewsd.cxx index f0ae22e2dec2..64e6d80eab4d 100644 --- a/sd/source/ui/view/drviewsd.cxx +++ b/sd/source/ui/view/drviewsd.cxx @@ -55,8 +55,7 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq ) { case SID_NAVIGATOR_INIT: { - sal_uInt16 nId = SID_NAVIGATOR; - SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId ); + SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( SID_NAVIGATOR ); if( pWindow ) { SdNavigatorWin* pNavWin = static_cast<SdNavigatorWin*>( pWindow->GetContextWindow( SD_MOD() ) ); @@ -154,7 +153,6 @@ void DrawViewShell::GetNavigatorWinState( SfxItemSet& rSet ) { NavState nState = NavState::NONE; sal_uInt16 nCurrentPage = 0; - sal_uInt16 nFirstPage = 0; sal_uInt16 nLastPage; OUString aPageName; @@ -169,7 +167,7 @@ void DrawViewShell::GetNavigatorWinState( SfxItemSet& rSet ) // first page / previous page - if( nCurrentPage == nFirstPage ) + if( nCurrentPage == 0 ) { nState |= NavState::BtnFirstDisabled | NavState::BtnPrevDisabled; } diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 32375a57748f..d18e0006fdfe 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -835,7 +835,6 @@ IMPL_LINK( View, ExecuteNavigatorDrop, void*, p, void ) == sal_False -> User canceled). */ bool bLink = pPageObjsTransferable->GetDragType() == NAVIGATOR_DRAGTYPE_LINK; bool bNameOK = GetExchangeList( aExchangeList, aBookmarkList, 2 ); - bool bReplace = false; /* Since we don't know the type (page or object), we fill a list with pages and objects. @@ -844,7 +843,7 @@ IMPL_LINK( View, ExecuteNavigatorDrop, void*, p, void ) if( bNameOK ) { mrDoc.InsertBookmark( aBookmarkList, aExchangeList, - bLink, bReplace, nPgPos, + bLink, false/*bReplace*/, nPgPos, &pPageObjsTransferable->GetDocShell(), &aPos ); } diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index c71d773b3b97..c72d90886dc6 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -227,8 +227,7 @@ void ViewShell::construct() mpScrollBarBox.reset(VclPtr<ScrollBarBox>::Create(GetParentWindow(), WB_SIZEABLE)); } - OUString aName( "ViewShell" ); - SetName (aName); + SetName ("ViewShell"); GetDoc()->StartOnlineSpelling(false); @@ -908,8 +907,7 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& if(bOutliner) { SfxStyleSheetBasePool* pSSPool = mpView->GetDocSh()->GetStyleSheetPool(); - OUString aStyleName(STR_LAYOUT_OUTLINE " 1"); - SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( aStyleName, SD_STYLE_FAMILY_PSEUDO); + SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( STR_LAYOUT_OUTLINE " 1", SD_STYLE_FAMILY_PSEUDO); if( pFirstStyleSheet ) pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, false, reinterpret_cast<const SfxPoolItem**>(&pItem)); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
