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

loplugin:unused-returns in drawinglayer..svx

Change-Id: I033a78cc7fe7d8e5086f1c855c4aa371cc98dc7c
Reviewed-on: https://gerrit.libreoffice.org/48400Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 945a1196
......@@ -229,7 +229,7 @@ namespace drawinglayer
return mrDevice.GetTextWidth(rText, nIndex, nLength);
}
bool TextLayouterDevice::getTextOutlines(
void TextLayouterDevice::getTextOutlines(
basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
const OUString& rText,
sal_uInt32 nIndex,
......@@ -255,7 +255,7 @@ namespace drawinglayer
aIntegerDXArray[a] = basegfx::fround(rDXArray[a]);
}
return mrDevice.GetTextOutlines(
mrDevice.GetTextOutlines(
rB2DPolyPolyVector,
rText,
nIndex,
......@@ -266,7 +266,7 @@ namespace drawinglayer
}
else
{
return mrDevice.GetTextOutlines(
mrDevice.GetTextOutlines(
rB2DPolyPolyVector,
rText,
nIndex,
......
......@@ -362,11 +362,10 @@ void SvxAutoCorrect::SetAutoCorrFlag( long nFlag, bool bOn )
// Two capital letters at the beginning of word?
bool SvxAutoCorrect::FnCapitalStartWord( SvxAutoCorrDoc& rDoc, const OUString& rTxt,
void SvxAutoCorrect::FnCapitalStartWord( SvxAutoCorrDoc& rDoc, const OUString& rTxt,
sal_Int32 nSttPos, sal_Int32 nEndPos,
LanguageType eLang )
{
bool bRet = false;
CharClass& rCC = GetCharClass( eLang );
// Delete all non alphanumeric. Test the characters at the beginning/end of
......@@ -431,7 +430,7 @@ bool SvxAutoCorrect::FnCapitalStartWord( SvxAutoCorrDoc& rDoc, const OUString& r
Sequence< css::beans::PropertyValue > aEmptySeq;
if (xSpeller->isValid(sWord, static_cast<sal_uInt16>(eLang), aEmptySeq))
{
return false;
return;
}
}
sal_Unicode cSave = rTxt[ nSttPos ];
......@@ -441,12 +440,10 @@ bool SvxAutoCorrect::FnCapitalStartWord( SvxAutoCorrDoc& rDoc, const OUString& r
{
if( SaveWordWrdSttLst & nFlags )
rDoc.SaveCpltSttWord( CapitalStartWord, nSttPos, sWord, cSave );
bRet = true;
}
}
}
}
return bRet;
}
......@@ -822,14 +819,14 @@ bool SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const OUString& rT
}
bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
void SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
const OUString& rTxt, bool bNormalPos,
sal_Int32 nSttPos, sal_Int32 nEndPos,
LanguageType eLang )
{
if( rTxt.isEmpty() || nEndPos <= nSttPos )
return false;
return;
CharClass& rCC = GetCharClass( eLang );
OUString aText( rTxt );
......@@ -862,14 +859,14 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
} while( !bAtStart );
if (!pWordStt)
return false; // no character to be replaced
return; // no character to be replaced
if (rCC.isDigit(aText, pStr - pStart))
return false; // already ok
return; // already ok
if (IsUpperLetter(rCC.getCharacterType(aText, pWordStt - pStart)))
return false; // already ok
return; // already ok
//See if the text is the start of a protocol string, e.g. have text of
//"http" see if it is the start of "http:" and if so leave it alone
......@@ -878,15 +875,15 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
if (nIndex + nProtocolLen <= rTxt.getLength())
{
if (INetURLObject::CompareProtocolScheme(rTxt.copy(nIndex, nProtocolLen)) != INetProtocol::NotValid)
return false; // already ok
return; // already ok
}
if (0x1 == *pWordStt || 0x2 == *pWordStt)
return false; // already ok
return; // already ok
if( *pDelim && 2 >= pDelim - pWordStt &&
lcl_IsInAsciiArr( ".-)>", *pDelim ) )
return false;
return;
if( !bAtStart ) // Still no beginning of a paragraph?
{
......@@ -899,7 +896,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
// and full width question marks are treated as word delimiters
else if ( 0x3002 != *pStr && 0xFF0E != *pStr && 0xFF01 != *pStr &&
0xFF1F != *pStr )
return false; // no valid separator -> no replacement
return; // no valid separator -> no replacement
}
if( bAtStart ) // at the beginning of a paragraph?
......@@ -912,8 +909,9 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
// valid separator -> replace
OUString sChar( *pWordStt );
sChar = rCC.titlecase(sChar); //see fdo#56740
return !comphelper::string::equals(sChar, *pWordStt) &&
rDoc.ReplaceRange( pWordStt - pStart, 1, sChar );
if (!comphelper::string::equals(sChar, *pWordStt))
rDoc.ReplaceRange( pWordStt - pStart, 1, sChar );
return;
}
aText = *pPrevPara;
......@@ -929,7 +927,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
} while( !bAtStart );
if( bAtStart )
return false; // no valid separator -> no replacement
return; // no valid separator -> no replacement
}
// Found [ \t]+[A-Z0-9]+ until here. Test now on the paragraph separator.
......@@ -954,10 +952,10 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
//previous word is a . So probably last word is an
//anagram that ends in . and not truly the end of a
//previous sentence, so don't autocapitalize this word
return false;
return;
}
if( nFlag & Flags::FullStop )
return false; // no valid separator -> no replacement
return; // no valid separator -> no replacement
nFlag |= Flags::FullStop;
pExceptStt = pStr;
}
......@@ -966,7 +964,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
case 0xFF01 :
{
if( nFlag & Flags::ExclamationMark )
return false; // no valid separator -> no replacement
return; // no valid separator -> no replacement
nFlag |= Flags::ExclamationMark;
}
break;
......@@ -974,13 +972,13 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
case 0xFF1F :
{
if( nFlag & Flags::QuestionMark)
return false; // no valid separator -> no replacement
return; // no valid separator -> no replacement
nFlag |= Flags::QuestionMark;
}
break;
default:
if( nFlag == Flags::NONE )
return false; // no valid separator -> no replacement
return; // no valid separator -> no replacement
else
bContinue = false;
break;
......@@ -988,7 +986,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
if( bContinue && pStr-- == pStart )
{
return false; // no valid separator -> no replacement
return; // no valid separator -> no replacement
}
} while( bContinue );
if( Flags::FullStop != nFlag )
......@@ -996,7 +994,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
}
if( 2 > ( pStr - pStart ) )
return false;
return;
if (!rCC.isLetterNumeric(aText, pStr-- - pStart))
{
......@@ -1029,7 +1027,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
}
if( !bValid )
return false; // no valid separator -> no replacement
return; // no valid separator -> no replacement
}
bool bNumericOnly = '0' <= *(pStr+1) && *(pStr+1) <= '9';
......@@ -1047,7 +1045,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
}
if( bNumericOnly ) // consists of only numbers, then not
return false;
return;
if (NonFieldWordDelim(*pStr))
++pStr;
......@@ -1059,7 +1057,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
{
sWord = OUString(pStr, pExceptStt - pStr + 1);
if( FindInCplSttExceptList(eLang, sWord) )
return false;
return;
// Delete all non alphanumeric. Test the characters at the
// beginning/end of the word ( recognizes: "(min.", "/min.", and so on.)
......@@ -1078,10 +1076,10 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
if( !sTmp.isEmpty() && sTmp.getLength() != sWord.getLength() &&
FindInCplSttExceptList(eLang, sTmp))
return false;
return;
if(FindInCplSttExceptList(eLang, sWord, true))
return false;
return;
}
// Ok, then replace
......@@ -1094,8 +1092,6 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
// Perhaps someone wants to have the word
if( bRet && SaveWordCplSttLst & nFlags )
rDoc.SaveCpltSttWord( CapitalStartSentence, nSttPos, sWord, cSave );
return bRet;
}
bool SvxAutoCorrect::FnCorrectCapsLock( SvxAutoCorrDoc& rDoc, const OUString& rTxt,
......@@ -2585,7 +2581,7 @@ bool SvxAutoCorrectLanguageLists::PutText( const OUString& rShort, const OUStrin
return bRet;
}
bool SvxAutoCorrectLanguageLists::PutText( const OUString& rShort,
void SvxAutoCorrectLanguageLists::PutText( const OUString& rShort,
SfxObjectShell& rShell )
{
// First get the current list!
......@@ -2617,8 +2613,6 @@ bool SvxAutoCorrectLanguageLists::PutText( const OUString& rShort,
catch ( const uno::Exception& )
{
}
return bRet;
}
// Keep the list sorted ...
......
......@@ -218,7 +218,7 @@ void HWPFile::ParaListRead()
ReadParaList(plist);
}
bool HWPFile::ReadParaList(std::vector < HWPPara* > &aplist)
void HWPFile::ReadParaList(std::vector < HWPPara* > &aplist)
{
std::unique_ptr<HWPPara> spNode( new HWPPara );
unsigned char tmp_etcflag;
......@@ -249,8 +249,6 @@ bool HWPFile::ReadParaList(std::vector < HWPPara* > &aplist)
aplist.push_back(spNode.release());
spNode.reset( new HWPPara );
}
return true;
}
bool HWPFile::ReadParaList(std::vector< std::unique_ptr<HWPPara> > &aplist, unsigned char flag)
......
......@@ -162,7 +162,7 @@ class DLLEXPORT HWPFile
* Reads main paragraph list
*/
bool ReadParaList(std::vector<std::unique_ptr<HWPPara>> &aplist, unsigned char flag = 0);
bool ReadParaList(std::vector<HWPPara*> &aplist);
void ReadParaList(std::vector<HWPPara*> &aplist);
/**
* Sets if the stream is compressed
*/
......
......@@ -157,10 +157,10 @@ static const size_t nTabSize = SAL_N_ELEMENTS(aDinTab);
#define MAXSLOPPY 21
bool PaperInfo::doSloppyFit()
void PaperInfo::doSloppyFit()
{
if (m_eType != PAPER_USER)
return true;
return;
for ( size_t i = 0; i < nTabSize; ++i )
{
......@@ -174,11 +174,9 @@ bool PaperInfo::doSloppyFit()
m_nPaperWidth = aDinTab[i].m_nWidth;
m_nPaperHeight = aDinTab[i].m_nHeight;
m_eType = static_cast<Paper>(i);
return true;
return;
}
}
return false;
}
bool PaperInfo::sloppyEqual(const PaperInfo &rOther) const
......
......@@ -86,7 +86,7 @@ namespace drawinglayer
sal_uInt32 nIndex,
sal_uInt32 nLength) const;
bool getTextOutlines(
void getTextOutlines(
basegfx::B2DPolyPolygonVector&,
const rtl::OUString& rText,
sal_uInt32 nIndex,
......
......@@ -218,7 +218,7 @@ public:
// - pure Text
bool PutText( const OUString& rShort, const OUString& rLong );
// - Text with attribution (only the SWG - SWG format!)
bool PutText( const OUString& rShort, SfxObjectShell& );
void PutText( const OUString& rShort, SfxObjectShell& );
// - Make combined changes in one pass
bool MakeCombinedChanges( std::vector<SvxAutocorrWord>& aNewEntries, std::vector<SvxAutocorrWord>& aDeleteEntries );
};
......@@ -376,7 +376,7 @@ public:
bool bAbbreviation = false);
// Methods for the auto-correction
bool FnCapitalStartWord( SvxAutoCorrDoc&, const OUString&,
void FnCapitalStartWord( SvxAutoCorrDoc&, const OUString&,
sal_Int32 nSttPos, sal_Int32 nEndPos,
LanguageType eLang );
bool FnChgOrdinalNumber( SvxAutoCorrDoc&, const OUString&,
......@@ -393,7 +393,7 @@ public:
LanguageType eLang );
bool FnChgWeightUnderl( SvxAutoCorrDoc&, const OUString&,
sal_Int32 nEndPos );
bool FnCapitalStartSentence( SvxAutoCorrDoc&, const OUString&, bool bNormalPos,
void FnCapitalStartSentence( SvxAutoCorrDoc&, const OUString&, bool bNormalPos,
sal_Int32 nSttPos, sal_Int32 nEndPos,
LanguageType eLang);
bool FnCorrectCapsLock( SvxAutoCorrDoc&, const OUString&,
......
......@@ -128,7 +128,7 @@ public:
long getWidth() const { return m_nPaperWidth; }
long getHeight() const { return m_nPaperHeight; }
bool sloppyEqual(const PaperInfo &rOther) const;
bool doSloppyFit();
void doSloppyFit();
static PaperInfo getSystemDefaultPaper();
static PaperInfo getDefaultPaperForLocale(const css::lang::Locale & rLocale);
......
......@@ -100,7 +100,7 @@ public:
void InsertDDELink( SvBaseLink* );
// Connect the links to a pseudo-object and add to the list
bool InsertFileLink( sfx2::SvBaseLink&,
void InsertFileLink( sfx2::SvBaseLink&,
sal_uInt16 nFileType,
const OUString& rFileNm,
const OUString* pFilterNm = nullptr,
......
......@@ -125,7 +125,7 @@ public:
bool moveTemplate (const ThumbnailViewItem* pItem, const sal_uInt16 nSrcItem,
const sal_uInt16 nTargetItem);
bool moveTemplates (const std::set<const ThumbnailViewItem*,selection_cmp_fn> &rItems, const sal_uInt16 nTargetItem);
void moveTemplates (const std::set<const ThumbnailViewItem*,selection_cmp_fn> &rItems, const sal_uInt16 nTargetItem);
bool copyFrom(TemplateContainerItem *pItem, const OUString &rPath);
......
......@@ -126,7 +126,7 @@ public:
static void ReleaseObject(SgaObject* pObj);
bool InsertObject(const SgaObject& rObj, sal_uInt32 nPos = SAL_MAX_UINT32);
bool RemoveObject(sal_uInt32 nPos);
void RemoveObject(sal_uInt32 nPos);
SAL_DLLPRIVATE bool ChangeObjectPos(sal_uInt32 nOldPos, sal_uInt32 nNewPos);
const OUString& GetName() const;
......
......@@ -189,7 +189,7 @@ public:
virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
const OUString& rMimeType, const css::uno::Any & rValue ) override;
bool Connect() { return GetRealObject() != nullptr; }
void Connect() { GetRealObject(); }
};
#endif // INCLUDED_SVX_SVDOOLE2_HXX
......
......@@ -699,10 +699,8 @@ SfxStyleSheetBasePool* DrawDocShell::GetStyleSheetPool()
return mpDoc->GetStyleSheetPool();
}
bool DrawDocShell::GotoBookmark(const OUString& rBookmark)
void DrawDocShell::GotoBookmark(const OUString& rBookmark)
{
bool bFound = false;
if (mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr)
{
DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(mpViewShell);
......@@ -762,7 +760,6 @@ bool DrawDocShell::GotoBookmark(const OUString& rBookmark)
{
// Jump to the bookmarked page. This is done in three steps.
bFound = true;
SdPage* pPage;
if (bIsMasterPage)
pPage = static_cast<SdPage*>( mpDoc->GetMasterPage(nPageNumber) );
......@@ -774,7 +771,7 @@ bool DrawDocShell::GotoBookmark(const OUString& rBookmark)
PageKind eNewPageKind = pPage->GetPageKind();
if( (eNewPageKind != PageKind::Standard) && (mpDoc->GetDocumentType() == DocumentType::Draw) )
return false;
return;
if (eNewPageKind != pDrawViewShell->GetPageKind())
{
......@@ -857,8 +854,6 @@ bool DrawDocShell::GotoBookmark(const OUString& rBookmark)
rBindings.Invalidate(SID_NAVIGATOR_STATE, true);
rBindings.Invalidate(SID_NAVIGATOR_PAGENAME);
}
return bFound;
}
/**
......
......@@ -129,7 +129,7 @@ public:
void Disconnect(sd::ViewShell const * pViewSh);
void UpdateTablePointers();
bool GotoBookmark(const OUString& rBookmark);
void GotoBookmark(const OUString& rBookmark);
Bitmap GetPagePreviewBitmap(SdPage* pPage);
......
......@@ -311,7 +311,7 @@ public:
return m_aResults;
}
bool collect()
void collect()
{
// Set to MASTER mode
EditMode eOldMode = m_rDrawViewShell.GetEditMode();
......@@ -345,13 +345,12 @@ public:
if (hasCustomPropertyField(aSections, m_aKeyCreator.makeCategoryNameKey()))
{
iterateSectionsAndCollect(aSections, rEditText);
return true;
return;
}
}
}
}
}
return false;
}
};
......
......@@ -434,12 +434,12 @@ void LinkManager::LinkServerShell(const OUString& rPath, SfxObjectShell& rServer
}
}
bool LinkManager::InsertFileLink(
void LinkManager::InsertFileLink(
sfx2::SvBaseLink& rLink, sal_uInt16 nFileType, const OUString& rFileNm,
const OUString* pFilterNm, const OUString* pRange)
{
if (!(OBJECT_CLIENT_SO & rLink.GetObjType()))
return false;
return;
OUStringBuffer aBuf;
aBuf.append(rFileNm);
......@@ -455,7 +455,7 @@ bool LinkManager::InsertFileLink(
}
OUString aCmd = aBuf.makeStringAndClear();
return InsertLink(&rLink, nFileType, SfxLinkUpdateMode::ONCALL, &aCmd);
InsertLink(&rLink, nFileType, SfxLinkUpdateMode::ONCALL, &aCmd);
}
// A transfer is aborted, so cancel all download media
......
......@@ -573,11 +573,9 @@ bool TemplateLocalView::moveTemplate (const ThumbnailViewItem *pItem, const sal_
return false;
}
bool TemplateLocalView::moveTemplates(const std::set<const ThumbnailViewItem*, selection_cmp_fn> &rItems,
void TemplateLocalView::moveTemplates(const std::set<const ThumbnailViewItem*, selection_cmp_fn> &rItems,
const sal_uInt16 nTargetItem)
{
bool ret = true;
TemplateContainerItem *pTarget = nullptr;
TemplateContainerItem *pSrc = nullptr;
......@@ -623,12 +621,11 @@ bool TemplateLocalView::moveTemplates(const std::set<const ThumbnailViewItem*, s
sMsg = sMsg.replaceFirst("$1",getRegionName(nTargetRegion));
ScopedVclPtrInstance<MessageDialog>(this, sMsg.replaceFirst( "$2",pViewItem->maTitle))->Execute();
return false; //return if any single move operation fails
return; //return if any single move operation fails
}
if (!mpDocTemplates->Copy(nTargetRegion,nTargetIdx,nSrcRegionId,pViewItem->mnDocId))
{
ret = false;
continue;
}
}
......@@ -691,10 +688,6 @@ bool TemplateLocalView::moveTemplates(const std::set<const ThumbnailViewItem*, s
Invalidate();
}
}
else
ret = false;
return ret;
}
bool TemplateLocalView::copyFrom (TemplateContainerItem *pItem, const OUString &rPath)
......
......@@ -1127,9 +1127,9 @@ void EventMultiplexer::notifyViewRemoved( const UnoViewSharedPtr& rView )
{ return pHandler.lock()->viewRemoved( rView ); } );
}
bool EventMultiplexer::notifyViewChanged( const UnoViewSharedPtr& rView )
void EventMultiplexer::notifyViewChanged( const UnoViewSharedPtr& rView )
{
return mpImpl->maViewHandlers.applyAll(
mpImpl->maViewHandlers.applyAll(
[&rView]( const ViewEventHandlerWeakPtr& pHandler )
{ return pHandler.lock()->viewChanged( rView ); } );
}
......
......@@ -461,7 +461,7 @@ public:
@param rView
View that has changed
*/
bool notifyViewChanged( const UnoViewSharedPtr& rView );
void notifyViewChanged( const UnoViewSharedPtr& rView );
/** View changed
......
......@@ -24,16 +24,15 @@ SmOoxmlExport::SmOoxmlExport(const SmNode *const pIn, OoxmlVersion const v,
{
}
bool SmOoxmlExport::ConvertFromStarMath( const ::sax_fastparser::FSHelperPtr& serializer )
void SmOoxmlExport::ConvertFromStarMath( const ::sax_fastparser::FSHelperPtr& serializer )
{
if( m_pTree == nullptr )
return false;
return;
m_pSerializer = serializer;
m_pSerializer->startElementNS( XML_m, XML_oMath,
FSNS( XML_xmlns, XML_m ), "http://schemas.openxmlformats.org/officeDocument/2006/math", FSEND );
HandleNode( m_pTree, 0 );
m_pSerializer->endElementNS( XML_m, XML_oMath );
return true;
}
// NOTE: This is still work in progress and unfinished, but it already covers a good
......
......@@ -24,7 +24,7 @@ class SmOoxmlExport : public SmWordExportBase
public:
SmOoxmlExport(const SmNode* pIn, oox::core::OoxmlVersion version,
oox::drawingml::DocumentType documentType);
bool ConvertFromStarMath( const ::sax_fastparser::FSHelperPtr& m_pSerializer );
void ConvertFromStarMath( const ::sax_fastparser::FSHelperPtr& m_pSerializer );
private:
void HandleVerticalStack( const SmNode* pNode, int nLevel ) override;
void HandleText( const SmNode* pNode, int nLevel ) override;
......
......@@ -453,7 +453,7 @@ void GalleryTheme::ReleaseObject( SgaObject* pObject )
delete pObject;
}
bool GalleryTheme::RemoveObject(sal_uInt32 nPos)
void GalleryTheme::RemoveObject(sal_uInt32 nPos)
{
GalleryObject* pEntry = nullptr;
if ( nPos < aObjectList.size() )
......@@ -475,13 +475,10 @@ bool GalleryTheme::RemoveObject(sal_uInt32 nPos)
Broadcast( GalleryHint( GalleryHintType::CLOSE_OBJECT, GetName(), pEntry ) );
Broadcast( GalleryHint( GalleryHintType::OBJECT_REMOVED, GetName(), pEntry ) );
delete pEntry;
pEntry = nullptr;
ImplSetModified( true );
ImplBroadcast( nPos );
}
return( pEntry != nullptr );
}
bool GalleryTheme::ChangeObjectPos(sal_uInt32 nOldPos, sal_uInt32 nNewPos)
......
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