loplugin:unusedmethods

Change-Id: Ib89ab59f7ad7e90b2a44ddd122176cde904fba4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135520
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2022-06-08 20:04:28 +02:00
parent 0e1a0ecffa
commit 485300f9ae
24 changed files with 3 additions and 310 deletions

View file

@ -218,10 +218,6 @@ public:
static void convertDuration(OUStringBuffer& rBuffer,
const css::util::Duration& rDuration);
/** convert XMLSchema-2 "duration" string to double; negative durations allowed */
static bool convertDuration(double & rfTime,
std::u16string_view rString);
/** convert XMLSchema-2 "duration" string to double; negative durations allowed */
static bool convertDuration(double & rfTime,
std::string_view rString);

View file

@ -73,11 +73,6 @@ public:
bool bExcludeImportSubsets,
sal_uInt32 nExcludeInfoFlags = 0);
/** Fill with all known MIME encodings and select the best according to
<method>GetBestMimeEncoding</method>
*/
void FillWithMimeAndSelectBest();
void InsertTextEncoding( const rtl_TextEncoding nEnc );
void InsertTextEncoding( const rtl_TextEncoding nEnc,

View file

@ -806,28 +806,6 @@ public:
Utf32
};
/** Encode some text as part of a URI.
@param rText Some text (for its interpretation, see the general
discussion for set-methods).
@param ePart The part says which characters are 'forbidden' and must
be encoded (replaced by escape sequences). Characters outside the US-
ASCII range are always 'forbidden.'
@param eMechanism See the general discussion for set-methods.
@param eCharset See the general discussion for set-methods.
@return The text, encoded according to the given mechanism and
charset ('forbidden' characters replaced by escape sequences).
*/
static void encode( OUStringBuffer& rOutputBuffer,
std::u16string_view rText, Part ePart,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset
= RTL_TEXTENCODING_UTF8);
/** Encode some text as part of a URI.
@param rText Some text (for its interpretation, see the general
@ -1310,15 +1288,6 @@ inline bool INetURLObject::SetMark(std::u16string_view rTheFragment,
setFragment(rTheFragment, eMechanism, eCharset);
}
// static
inline void INetURLObject::encode(OUStringBuffer& rOutputBuffer,
std::u16string_view rText, Part ePart,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
encodeText(rOutputBuffer, rText, ePart, eMechanism, eCharset, false);
}
// static
inline OUString INetURLObject::encode(std::u16string_view rText, Part ePart,
EncodeMechanism eMechanism,

View file

@ -72,7 +72,6 @@ public:
bool EqualIgnoreColor( const FontMetric& ) const;
// Compute value usable as hash.
size_t GetHashValue() const;
size_t GetHashValueIgnoreColor() const;
private:

View file

@ -31,7 +31,6 @@
#include <optional>
namespace com::sun::star::graphic { class XPrimitive2D; }
struct WmfExternal;
typedef css::uno::Sequence<sal_Int8> VectorGraphicDataArray;
@ -69,9 +68,6 @@ private:
size_t mNestedBitmapSize;
VectorGraphicDataType meType;
// extra:
std::unique_ptr<WmfExternal> mpExternalHeader;
/// If the vector format has more pages this denotes which page to render
sal_Int32 mnPageIndex;
@ -99,9 +95,6 @@ public:
/// compare op
bool operator==(const VectorGraphicData& rCandidate) const;
/// special: needed for emf/wmf, maybe replaced by scaling the result later (?)
void setWmfExternalHeader(const WmfExternal& aExtHeader);
/// data read
const BinaryDataContainer& getBinaryDataContainer() const
{

View file

@ -258,11 +258,6 @@ public:
std::string_view rString,
const css::util::Date& aNullDate);
/** convert string to ::basegfx::B3DVector */
static bool convertB3DVector( ::basegfx::B3DVector& rVector,
std::u16string_view rValue );
/** convert string to ::basegfx::B3DVector */
static bool convertB3DVector( ::basegfx::B3DVector& rVector,
std::string_view rValue );

View file

@ -1063,16 +1063,6 @@ static bool convertDurationHelper(double& rfTime, V pStr)
return bSuccess;
}
/** convert ISO "duration" string to double; negative durations allowed */
bool Converter::convertDuration(double& rfTime,
std::u16string_view rString)
{
std::u16string_view aTrimmed = trim(rString);
const sal_Unicode* pStr = aTrimmed.data();
return convertDurationHelper(rfTime, pStr);
}
/** convert ISO "duration" string to double; negative durations allowed */
bool Converter::convertDuration(double& rfTime,
std::string_view rString)

View file

@ -66,7 +66,6 @@ public:
~SmElementsControl();
static const std::vector<TranslateId>& categories();
const TranslateId& elementSetId() const { return msCurrentSetId; }
void setElementSetId(TranslateId pSetId);
void setVerticalMode(bool bVertical);

View file

@ -469,15 +469,6 @@ private:
maCmdText.append( rText );
}
/**
* Appends rText to the OUStringBuffer ( maCmdText ).
* @param rText
* @return
*/
void Append( const char* rText ) {
maCmdText.append( OUString::createFromAscii(rText) );
}
/**
* Append a blank for separation, if needed.
* It is needed if last char is not ' '.

View file

@ -206,13 +206,6 @@ void SvxTextEncodingTreeView::FillFromTextEncodingTable(
m_xControl->thaw();
}
void SvxTextEncodingBox::FillWithMimeAndSelectBest()
{
FillFromTextEncodingTable( false, 0xffffffff, RTL_TEXTENCODING_INFO_MIME );
rtl_TextEncoding nEnc = SvtSysLocale::GetBestMimeEncoding();
SelectTextEncoding( nEnc );
}
void SvxTextEncodingBox::InsertTextEncoding( const rtl_TextEncoding nEnc,
const OUString& rEntry )
{

View file

@ -67,16 +67,10 @@ public:
sal_uInt16 GetValueCount() const override;
void InvalidateLineBreak();
css::uno::Reference<css::text::XTextRange> GetAnchor() const;
void SetTextLineBreak(SwTextLineBreak* pTextAttr) { m_pTextAttr = pTextAttr; }
const SwTextLineBreak* GetTextLineBreak() const { return m_pTextAttr; }
SwTextLineBreak* GetTextLineBreak() { return m_pTextAttr; }
css::uno::WeakReference<css::text::XTextContent> const& GetXTextContent() const
{
return m_wXLineBreak;

View file

@ -83,8 +83,6 @@ public:
bool SetContentRange(SwTextNode*& rpNode, sal_Int32& rStart, sal_Int32& rEnd) const;
const css::uno::Reference<css::text::XText>& GetParentText() const;
bool CheckForOwnMemberContentControl(const SwPaM& rPam, const bool bAbsorb);
static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
// XUnoTunnel

View file

@ -69,13 +69,6 @@ sal_uInt16 SwFormatLineBreak::GetValueCount() const
return static_cast<sal_uInt16>(SwLineBreakClear::LAST) + 1;
}
void SwFormatLineBreak::InvalidateLineBreak()
{
SwPtrMsgPoolItem const aItem(RES_REMOVE_UNO_OBJECT,
&static_cast<sw::BroadcastingModify&>(*this));
CallSwClientNotify(sw::LegacyModifyHint(&aItem, &aItem));
}
uno::Reference<text::XTextRange> SwFormatLineBreak::GetAnchor() const
{
SolarMutexGuard aGuard;

View file

@ -337,65 +337,6 @@ bool SwXContentControl::SetContentRange(SwTextNode*& rpNode, sal_Int32& rStart,
return false;
}
bool SwXContentControl::CheckForOwnMemberContentControl(const SwPaM& rPam, bool bAbsorb)
{
SwTextNode* pTextNode;
sal_Int32 nContentControlStart;
sal_Int32 nContentControlEnd;
bool bSuccess = SetContentRange(pTextNode, nContentControlStart, nContentControlEnd);
if (!bSuccess)
{
SAL_WARN("sw.core", "SwXContentControl::CheckForOwnMemberContentControl: no pam");
throw lang::DisposedException();
}
const SwPosition* pStartPos(rPam.Start());
if (&pStartPos->nNode.GetNode() != pTextNode)
{
throw lang::IllegalArgumentException(
"trying to insert into a nesting text content, but start "
"of text range not in same paragraph as text content",
nullptr, 0);
}
bool bForceExpandHints(false);
sal_Int32 nStartPos = pStartPos->nContent.GetIndex();
if ((nStartPos < nContentControlStart) || (nStartPos > nContentControlEnd))
{
throw lang::IllegalArgumentException(
"trying to insert into a nesting text content, but start "
"of text range not inside text content",
nullptr, 0);
}
else if (nStartPos == nContentControlEnd)
{
bForceExpandHints = true;
}
if (rPam.HasMark() && bAbsorb)
{
const SwPosition* pEndPos = rPam.End();
if (&pEndPos->nNode.GetNode() != pTextNode)
{
throw lang::IllegalArgumentException(
"trying to insert into a nesting text content, but end "
"of text range not in same paragraph as text content",
nullptr, 0);
}
sal_Int32 nEndPos = pEndPos->nContent.GetIndex();
if ((nEndPos < nContentControlStart) || (nEndPos > nContentControlEnd))
{
throw lang::IllegalArgumentException(
"trying to insert into a nesting text content, but end "
"of text range not inside text content",
nullptr, 0);
}
else if (nEndPos == nContentControlEnd)
{
bForceExpandHints = true;
}
}
return bForceExpandHints;
}
const uno::Sequence<sal_Int8>& SwXContentControl::getUnoTunnelId()
{
static const comphelper::UnoIdInit theSwXContentControlUnoTunnelId;

View file

@ -1455,10 +1455,6 @@ public:
return static_cast<const T*>(HasTextItem(sal_uInt16(nWhich)));
}
virtual const SfxPoolItem& GetItem( sal_uInt16 nWhich ) const = 0;
template<class T> const T* GetItem( TypedWhichId<T> nWhich ) const
{
return static_cast<const T*>(GetItem(sal_uInt16(nWhich)));
}
};
/// Used to export formatted text associated to drawings.

View file

@ -80,11 +80,6 @@ public:
void SetRectanglePixel(const ::tools::Rectangle& rRect);
const SwPageFrame* GetPageFrame() const
{
return SwFrameMenuButtonBase::GetPageFrame(m_pFrame);
}
private:
DECL_LINK( FadeHandler, Timer *, void );
/// Hide the button when the menu is toggled closed, e.g by clicking outside

View file

@ -1090,8 +1090,6 @@ public:
return aSize;
}
PDFWriter::PDFVersion getVersion() const { return m_aContext.Version; }
void setDocumentLocale( const css::lang::Locale& rLoc )
{ m_aContext.DocumentLocale = rLoc; }

View file

@ -122,13 +122,6 @@ size_t FontMetric::GetHashValueNoBase() const
return hash;
}
size_t FontMetric::GetHashValue() const
{
size_t hash = GetHashValueNoBase();
o3tl::hash_combine( hash, Font::GetHashValue());
return hash;
}
size_t FontMetric::GetHashValueIgnoreColor() const
{
size_t hash = GetHashValueNoBase();

View file

@ -140,16 +140,6 @@ bool VectorGraphicData::operator==(const VectorGraphicData& rCandidate) const
return false;
}
void VectorGraphicData::setWmfExternalHeader(const WmfExternal& aExtHeader)
{
if (!mpExternalHeader)
{
mpExternalHeader.reset( new WmfExternal );
}
*mpExternalHeader = aExtHeader;
}
void VectorGraphicData::ensurePdfReplacement()
{
assert(getType() == VectorGraphicDataType::Pdf);
@ -226,15 +216,10 @@ void VectorGraphicData::ensureSequenceAndRange()
std::copy(maDataContainer.cbegin(), maDataContainer.cend(), aDataSequence.getArray());
const uno::Reference<io::XInputStream> xInputStream(new comphelper::SequenceInputStream(aDataSequence));
uno::Sequence< ::beans::PropertyValue > aPropertySequence;
if (mpExternalHeader)
{
aPropertySequence = mpExternalHeader->getSequence();
}
if (xInputStream.is())
{
uno::Sequence< ::beans::PropertyValue > aPropertySequence;
// Pass the size hint of the graphic to the EMF parser.
geometry::RealPoint2D aSizeHint;
aSizeHint.X = maSizeHint.getX();
@ -243,9 +228,7 @@ void VectorGraphicData::ensureSequenceAndRange()
if (!mbEnableEMFPlus)
{
auto aVector = comphelper::sequenceToContainer<std::vector<beans::PropertyValue>>(aPropertySequence);
aVector.push_back(comphelper::makePropertyValue("EMFPlusEnable", uno::Any(false)));
aPropertySequence = comphelper::containerToSequence(aVector);
aPropertySequence = { comphelper::makePropertyValue("EMFPlusEnable", uno::Any(false)) };
}
maSequence = comphelper::sequenceToContainer<std::deque<css::uno::Reference< css::graphic::XPrimitive2D >>>(xEmfParser->getDecomposition(xInputStream, OUString(), aPropertySequence));

View file

@ -175,20 +175,6 @@ SvTreeListEntry* IconViewImpl::GoToNextRow(SvTreeListEntry* pEntry, int nRows) c
return pNext;
}
SvTreeListEntry* IconViewImpl::GetFirstInRow(SvTreeListEntry* pEntry) const
{
SvTreeListEntry* pFirst = nullptr;
auto FindFirst = [pEntry, &pFirst](const EntryAreaInfo& info)
{
if (info.column == 0)
pFirst = info.entry;
return pEntry == info.entry ? CallbackResult::Stop : CallbackResult::Continue;
};
IterateVisibleEntryAreas(FindFirst);
return pFirst;
}
void IconViewImpl::CursorUp()
{
if (!m_pStartEntry)

View file

@ -83,8 +83,6 @@ private:
// Get first entry at most n rows below; nullptr if no rows below
SvTreeListEntry* GoToNextRow(SvTreeListEntry* pEntry, int n) const;
SvTreeListEntry* GetFirstInRow(SvTreeListEntry* pEntry) const;
tools::Long GetEntryRow(const SvTreeListEntry* entry) const;
void SetStartEntry(SvTreeListEntry* entry);
void ScrollTo(SvTreeListEntry* entry);

View file

@ -8350,47 +8350,6 @@ void DomainMapper_Impl::ApplySettingsTable()
}
}
uno::Reference<container::XIndexAccess> DomainMapper_Impl::GetCurrentNumberingRules(sal_Int32* pListLevel)
{
uno::Reference<container::XIndexAccess> xRet;
try
{
OUString aStyle = GetCurrentParaStyleName();
if (aStyle.isEmpty())
return xRet;
const StyleSheetEntryPtr pEntry = GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(aStyle);
if (!pEntry)
return xRet;
const StyleSheetPropertyMap* pStyleSheetProperties = pEntry->pProperties.get();
if (!pStyleSheetProperties)
return xRet;
sal_Int32 nListId = pStyleSheetProperties->GetListId();
if (nListId < 0)
return xRet;
if (pListLevel)
*pListLevel = pStyleSheetProperties->GetListLevel();
// So we are in a paragraph style and it has numbering. Look up the relevant numbering rules.
auto const pList(GetListTable()->GetList(nListId));
OUString aListName;
if (pList)
{
aListName = pList->GetStyleName();
}
uno::Reference< style::XStyleFamiliesSupplier > xStylesSupplier(GetTextDocument(), uno::UNO_QUERY_THROW);
uno::Reference< container::XNameAccess > xStyleFamilies = xStylesSupplier->getStyleFamilies();
uno::Reference<container::XNameAccess> xNumberingStyles;
xStyleFamilies->getByName("NumberingStyles") >>= xNumberingStyles;
uno::Reference<beans::XPropertySet> xStyle(xNumberingStyles->getByName(aListName), uno::UNO_QUERY);
xRet.set(xStyle->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
}
catch (const uno::Exception&)
{
TOOLS_WARN_EXCEPTION("writerfilter.dmapper", "GetCurrentNumberingRules: exception caught");
}
return xRet;
}
SectionPropertyMap * DomainMapper_Impl::GetSectionContext()
{
SectionPropertyMap* pSectionContext = nullptr;

View file

@ -1056,8 +1056,6 @@ public:
}
SectionPropertyMap * GetSectionContext();
/// If the current paragraph has a numbering style associated, this method returns its numbering rules
css::uno::Reference<css::container::XIndexAccess> GetCurrentNumberingRules(sal_Int32* pListLevel);
sal_Int16 GetListLevel(const StyleSheetEntryPtr& pEntry, const PropertyMapPtr& pParaContext = nullptr);
void ValidateListLevel(const OUString& sStyleIdentifierD);

View file

@ -550,37 +550,6 @@ bool SvXMLTokenEnumerator::getNextToken( std::u16string_view& rToken )
return true;
}
static bool lcl_getPositions(std::u16string_view _sValue, std::u16string_view& _rContentX, std::u16string_view& _rContentY, std::u16string_view& _rContentZ)
{
if(_sValue.empty() || _sValue[0] != '(')
return false;
size_t nPos(1);
size_t nFound = _sValue.find(' ', nPos);
if(nFound == std::u16string_view::npos || nFound <= nPos)
return false;
_rContentX = _sValue.substr(nPos, nFound - nPos);
nPos = nFound + 1;
nFound = _sValue.find(' ', nPos);
if(nFound == std::u16string_view::npos || nFound <= nPos)
return false;
_rContentY = _sValue.substr(nPos, nFound - nPos);
nPos = nFound + 1;
nFound = _sValue.find(')', nPos);
if(nFound == std::u16string_view::npos || nFound <= nPos)
return false;
_rContentZ = _sValue.substr(nPos, nFound - nPos);
return true;
}
static bool lcl_getPositions(std::string_view _sValue, std::string_view& _rContentX, std::string_view& _rContentY, std::string_view& _rContentZ)
{
if(_sValue.empty() || _sValue[0] != '(')
@ -613,34 +582,6 @@ static bool lcl_getPositions(std::string_view _sValue, std::string_view& _rConte
}
/** convert string to ::basegfx::B3DVector */
bool SvXMLUnitConverter::convertB3DVector( ::basegfx::B3DVector& rVector, std::u16string_view rValue )
{
std::u16string_view aContentX,aContentY,aContentZ;
if ( !lcl_getPositions(rValue,aContentX,aContentY,aContentZ) )
return false;
rtl_math_ConversionStatus eStatus;
rVector.setX(::rtl::math::stringToDouble(aContentX, '.',
',', &eStatus));
if( eStatus != rtl_math_ConversionStatus_Ok )
return false;
rVector.setY(::rtl::math::stringToDouble(aContentY, '.',
',', &eStatus));
if( eStatus != rtl_math_ConversionStatus_Ok )
return false;
rVector.setZ(::rtl::math::stringToDouble(aContentZ, '.',
',', &eStatus));
return ( eStatus == rtl_math_ConversionStatus_Ok );
}
/** convert string to ::basegfx::B3DVector */
bool SvXMLUnitConverter::convertB3DVector( ::basegfx::B3DVector& rVector, std::string_view rValue )
{