tdf#119840 small tweaks

Change-Id: Ie2c7a9633ee62bc1c4c0ad821d5ff1ace71fc15d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177928
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin 2024-12-06 10:07:34 +02:00
parent 5950fe86b8
commit e7268b7d9e
2 changed files with 9 additions and 6 deletions

View file

@ -1217,16 +1217,17 @@ namespace
sal_Int32 *const pStart, sal_Int32 *const pEnd, sal_Int32 *const pStart, sal_Int32 *const pEnd,
bool bCaseSensitive = true) bool bCaseSensitive = true)
{ {
if (*pCurrent == *pSelf) if (pCurrent == pSelf)
return nullptr; return nullptr;
SwTextNode* pTextNode = pCurrent->GetTextNode(); SwTextNode* pTextNode = pCurrent->GetTextNode();
if (!pTextNode) if (!pTextNode)
return nullptr; return nullptr;
auto const & rFormatName = pTextNode->GetFormatColl()->GetName();
if (bCaseSensitive if (bCaseSensitive
? pTextNode->GetFormatColl()->GetName() == rStyleName ? rFormatName == rStyleName
: pTextNode->GetFormatColl()->GetName().equalsIgnoreAsciiCase(rStyleName)) : rFormatName.equalsIgnoreAsciiCase(rStyleName))
{ {
*pStart = 0; *pStart = 0;
if (pEnd) if (pEnd)
@ -1238,7 +1239,7 @@ namespace
if (auto const pHints = pTextNode->GetpSwpHints()) if (auto const pHints = pTextNode->GetpSwpHints())
{ {
for (size_t i = 0; i < pHints->Count(); ++i) for (size_t i = 0, nCnt = pHints->Count(); i < nCnt; ++i)
{ {
auto const*const pHint(pHints->Get(i)); auto const*const pHint(pHints->Get(i));
if (pHint->Which() == RES_TXTATR_CHARFMT) if (pHint->Which() == RES_TXTATR_CHARFMT)

View file

@ -410,12 +410,14 @@ static void lcl_FormatLay( SwLayoutFrame *pLay )
static void lcl_MakeObjs(const sw::FrameFormats<sw::SpzFrameFormat*>& rSpzs, SwPageFrame* pPage) static void lcl_MakeObjs(const sw::FrameFormats<sw::SpzFrameFormat*>& rSpzs, SwPageFrame* pPage)
{ {
// formats are in the special table of the document // formats are in the special table of the document
const sal_uInt16 nPhyPageNum = pPage->GetPhyPageNum();
size_t i = 0; size_t i = 0;
while (i < rSpzs.size()) const size_t nSpzsCnt = rSpzs.size();
while (i < nSpzsCnt)
{ {
auto pSpz = rSpzs[i]; auto pSpz = rSpzs[i];
const SwFormatAnchor &rAnch = pSpz->GetAnchor(); const SwFormatAnchor &rAnch = pSpz->GetAnchor();
if ( rAnch.GetPageNum() == pPage->GetPhyPageNum() ) if ( rAnch.GetPageNum() == nPhyPageNum )
{ {
if( rAnch.GetAnchorNode() ) if( rAnch.GetAnchorNode() )
{ {