Kaydet (Commit) 412215fb authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:returnconstant in sd

Change-Id: Ie48caf16bae9f85b61dd9614199f1b2d75783e6e
Reviewed-on: https://gerrit.libreoffice.org/58878
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst eb841c06
......@@ -160,11 +160,9 @@ void PPTWriter::exportPPTPost( )
ImplWriteVBA();
if ( !ImplWriteAtomEnding() )
return;
ImplWriteAtomEnding();
if ( !ImplCreateDocumentSummaryInformation() )
return;
ImplCreateDocumentSummaryInformation();
mbStatus = true;
};
......@@ -507,7 +505,7 @@ bool PPTWriter::ImplCreateCurrentUserStream()
return true;
};
bool PPTWriter::ImplCreateDocumentSummaryInformation()
void PPTWriter::ImplCreateDocumentSummaryInformation()
{
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
mXModel, uno::UNO_QUERY_THROW);
......@@ -553,8 +551,6 @@ bool PPTWriter::ImplCreateDocumentSummaryInformation()
nullptr, &aGuidSeq, &aHyperSeq );
}
}
return true;
}
void PPTWriter::ImplWriteExtParaHeader( SvMemoryStream& rSt, sal_uInt32 nRef, sal_uInt32 nInstance, sal_uInt32 nSlideId )
......@@ -1332,7 +1328,7 @@ void PPTWriter::ImplWriteOLE( )
// write PersistantTable and UserEditAtom
bool PPTWriter::ImplWriteAtomEnding()
void PPTWriter::ImplWriteAtomEnding()
{
#define EPP_LastViewTypeSlideView 1
......@@ -1436,8 +1432,6 @@ bool PPTWriter::ImplWriteAtomEnding()
.WriteUInt32( nPersistEntrys ) // max persists written, Seed value for persist object id management
.WriteInt16( EPP_LastViewTypeSlideView ) // last view type
.WriteInt16( 0x12 ); // padword
return true;
}
// - exported function -
......
......@@ -167,7 +167,7 @@ class PPTWriter final : public PPTWriterBase, public PPTExBulletProvider
private:
bool ImplCreateDocumentSummaryInformation();
void ImplCreateDocumentSummaryInformation();
bool ImplCreateCurrentUserStream();
static void ImplCreateHeaderFooterStrings( SvStream& rOut,
css::uno::Reference< css::beans::XPropertySet > const & rXPagePropSet );
......@@ -180,7 +180,7 @@ class PPTWriter final : public PPTWriterBase, public PPTExBulletProvider
void ImplWriteBackground( css::uno::Reference< css::beans::XPropertySet > const & rXBackgroundPropSet );
void ImplWriteVBA();
void ImplWriteOLE();
bool ImplWriteAtomEnding();
void ImplWriteAtomEnding();
void ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt );
bool ImplGetText();
......
......@@ -97,7 +97,7 @@ private:
virtual bool ImplCreateDocument() override;
virtual bool ImplCreateMainNotes() override;
virtual ::oox::ole::VbaProject* implCreateVbaProject() const override;
bool WriteNotesMaster();
void WriteNotesMaster();
static void WriteAnimateTo( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Any& rValue, const OUString& rAttributeName );
static void WriteAnimateValues( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimate >& rXAnimate );
......
......@@ -2858,7 +2858,7 @@ bool PowerPointExport::ImplCreateDocument()
return true;
}
bool PowerPointExport::WriteNotesMaster()
void PowerPointExport::WriteNotesMaster()
{
SAL_INFO("sd.eppt", "write Notes master\n---------------");
......@@ -2921,14 +2921,12 @@ bool PowerPointExport::WriteNotesMaster()
pFS->endElementNS(XML_p, XML_notesMaster);
SAL_INFO("sd.eppt", "----------------");
return true;
}
bool PowerPointExport::ImplCreateMainNotes()
{
if (mbCreateNotes)
return WriteNotesMaster();
WriteNotesMaster();
return true;
}
......
......@@ -785,8 +785,7 @@ void HtmlExport::ExportHtml()
if( !CreateContentPage() )
break;
if( !CreateBitmaps() )
break;
CreateBitmaps();
mpDocSh->SetWaitCursor( false );
ResetProgress();
......@@ -2661,7 +2660,7 @@ OUString HtmlExport::CreateNavBar( sal_uInt16 nSdPage, bool bIsText ) const
}
// export navigation graphics from button set
bool HtmlExport::CreateBitmaps()
void HtmlExport::CreateBitmaps()
{
if(mnButtonThema != -1 && mpButtonSet.get() )
{
......@@ -2678,7 +2677,6 @@ bool HtmlExport::CreateBitmaps()
mpButtonSet->exportButton( mnButtonThema, aFull, GetButtonName(nButton) );
}
}
return true;
}
// creates the <body> tag, including the specified color attributes
......
......@@ -151,7 +151,7 @@ class HtmlExport final
bool CreateHtmlForPresPages();
bool CreateContentPage();
void CreateFileNames();
bool CreateBitmaps();
void CreateBitmaps();
bool CreateOutlinePages();
bool CreateFrames();
bool CreateNotesPages();
......
......@@ -161,15 +161,14 @@ void FuMorph::DoExecute( SfxRequest& )
aPolyPoly2.setB2DPolygon(a, aSub2);
}
if(ImpMorphPolygons(aPolyPoly1, aPolyPoly2, pDlg->GetFadeSteps(), aPolyPolyList))
{
ImpMorphPolygons(aPolyPoly1, aPolyPoly2, pDlg->GetFadeSteps(), aPolyPolyList);
OUString aString(mpView->GetDescriptionOfMarkedObjects());
aString += " " + SdResId(STR_UNDO_MORPHING);
mpView->BegUndo(aString);
ImpInsertPolygons(aPolyPolyList, pDlg->IsAttributeFade(), pObj1, pObj2);
mpView->EndUndo();
}
for(basegfx::B2DPolyPolygon * p : aPolyPolyList) {
delete p;
......@@ -480,7 +479,7 @@ void FuMorph::ImpInsertPolygons(
/**
* create morphed PolyPolygons
*/
bool FuMorph::ImpMorphPolygons(
void FuMorph::ImpMorphPolygons(
const ::basegfx::B2DPolyPolygon& rPolyPoly1,
const ::basegfx::B2DPolyPolygon& rPolyPoly2,
const sal_uInt16 nSteps,
......@@ -511,7 +510,6 @@ bool FuMorph::ImpMorphPolygons(
rPolyPolyList3D.push_back( pNewPolyPoly2D );
}
}
return true;
}
} // end of namespace sd
......
......@@ -111,7 +111,7 @@ public:
sal_uLong GetPaperWidth() { return mnPaperWidth;}
bool PrepareClose();
void PrepareClose();
virtual void GetAttributes( SfxItemSet& rTargetSet, bool bOnlyHardAttr = false ) const override;
virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false) override;
......
......@@ -169,7 +169,7 @@ public:
const Point& rOffset,
const Size& rSize);
bool RelocateToWindow (vcl::Window* pWindow);
void RelocateToWindow (vcl::Window* pWindow);
/** Set the current function at the view shell or, when it is not
present, set it at the content window. This method supports the use
......
......@@ -63,7 +63,7 @@ private:
double fMorphingFactor
);
static bool ImpMorphPolygons(
static void ImpMorphPolygons(
const ::basegfx::B2DPolyPolygon& rPolyPoly1,
const ::basegfx::B2DPolyPolygon& rPolyPoly2,
const sal_uInt16 nSteps,
......
......@@ -106,7 +106,7 @@ public:
// helper api
bool startPreview(
void startPreview(
const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage,
const css::uno::Reference< css::animations::XAnimationNode >& xAnimationNode );
......
......@@ -183,10 +183,11 @@ bool SlideShow::StartPreview( ViewShellBase const & rBase,
const css::uno::Reference< css::animations::XAnimationNode >& xAnimationNode )
{
rtl::Reference< SlideShow > xSlideShow( GetSlideShow( rBase ) );
if( xSlideShow.is() )
return xSlideShow->startPreview( xDrawPage, xAnimationNode );
if( !xSlideShow.is() )
return false;
xSlideShow->startPreview( xDrawPage, xAnimationNode );
return true;
}
void SlideShow::Stop( ViewShellBase const & rBase )
......@@ -879,7 +880,7 @@ void SAL_CALL SlideShow::disposing()
mpDoc = nullptr;
}
bool SlideShow::startPreview( const Reference< XDrawPage >& xDrawPage, const Reference< XAnimationNode >& xAnimationNode )
void SlideShow::startPreview( const Reference< XDrawPage >& xDrawPage, const Reference< XAnimationNode >& xAnimationNode )
{
Sequence< PropertyValue > aArguments(4);
......@@ -896,8 +897,6 @@ bool SlideShow::startPreview( const Reference< XDrawPage >& xDrawPage, const Ref
aArguments[3].Value <<= Reference< XWindow >();
startWithArguments( aArguments );
return true;
}
OutputDevice* SlideShow::getShowWindow()
......
......@@ -358,7 +358,7 @@ void SlideSorter::ArrangeGUIElements (
}
}
bool SlideSorter::RelocateToWindow (vcl::Window* pParentWindow)
void SlideSorter::RelocateToWindow (vcl::Window* pParentWindow)
{
// Stop all animations for they have been started for the old window.
mpSlideSorterController->GetAnimator()->RemoveAllAnimations();
......@@ -383,8 +383,6 @@ bool SlideSorter::RelocateToWindow (vcl::Window* pParentWindow)
mpContentWindow->Hide();
mpContentWindow->Show();
}
return true;
}
void SlideSorter::SetCurrentFunction (const rtl::Reference<FuPoor>& rpFunction)
......
......@@ -288,10 +288,10 @@ bool SlideSorterViewShell::RelocateToParentWindow (vcl::Window* pParentWindow)
if ( ! mpSlideSorter)
return false;
const bool bSuccess (mpSlideSorter->RelocateToWindow(pParentWindow));
mpSlideSorter->RelocateToWindow(pParentWindow);
ReadFrameViewData(mpFrameView);
return bSuccess;
return true;
}
SfxUndoManager* SlideSorterViewShell::ImpGetUndoManager() const
......
......@@ -1335,7 +1335,7 @@ private:
/** Determine and set the paper orientation.
*/
bool SetupPaperOrientation (
void SetupPaperOrientation (
const PageKind ePageKind,
PrintInfo& rInfo)
{
......@@ -1376,8 +1376,6 @@ private:
maPrintSize = awt::Size(aPaperSize.Height(), aPaperSize.Width());
}
}
return true;
}
/** Top most method for preparing printer pages. In this and the other
......@@ -1869,8 +1867,7 @@ private:
SdPage* pRefPage = pDocument->GetSdPage(0, ePageKind);
rInfo.maPageSize = pRefPage->GetSize();
if ( ! SetupPaperOrientation(ePageKind, rInfo))
return;
SetupPaperOrientation(ePageKind, rInfo);
MapMode aMap (rInfo.maMap);
rInfo.maMap = aMap;
......
......@@ -464,7 +464,7 @@ public:
{
}
bool insert(std::vector<svx::ClassificationResult> const & rResults)
void insert(std::vector<svx::ClassificationResult> const & rResults)
{
// Set to MASTER mode
EditMode eOldMode = m_rDrawViewShell.GetEditMode();
......@@ -538,8 +538,6 @@ public:
pObject->SetLogicRect(::tools::Rectangle(aPosition, aTextSize));
}
return true;
}
};
......
......@@ -1114,7 +1114,9 @@ bool OutlineViewShell::PrepareClose( bool bUI )
if( !ViewShell::PrepareClose(bUI) )
return false;
return pOlView == nullptr || pOlView->PrepareClose();
if (pOlView)
pOlView->PrepareClose();
return true;
}
/**
......
......@@ -966,7 +966,7 @@ SdrTextObj* OutlineView::CreateOutlineTextObject(SdPage* pPage)
}
/** updates draw model with all changes from outliner model */
bool OutlineView::PrepareClose()
void OutlineView::PrepareClose()
{
::sd::UndoManager* pDocUndoMgr = dynamic_cast<sd::UndoManager*>(mpDocSh->GetUndoManager());
if (pDocUndoMgr != nullptr)
......@@ -978,7 +978,6 @@ bool OutlineView::PrepareClose()
UpdateDocument();
EndUndo();
mrDoc.SetSelected(GetActualPage(), true);
return true;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment