[Libreoffice-commits] core.git: editeng/source sc/source sd/qa

2022-11-03 Thread Stephan Bergmann (via logerrit)
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |3 +--
 sc/source/ui/drawfunc/drtxtob.cxx   |3 ++-
 sc/source/ui/view/editsh.cxx|3 ++-
 sd/qa/unit/tiledrendering/tiledrendering.cxx|8 
 4 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit e0121b2478526d803681d57d59af0cbf9cf602b4
Author: Stephan Bergmann 
AuthorDate: Thu Nov 3 09:14:18 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Nov 3 13:58:13 2022 +0100

-Werror=dangling-reference

In


"c++: Implement -Wdangling-reference [PR106393]" grew a new warning, 
included in
-Wall, and based on some more-or-less shaky heuristics, that warns about
"possibly dangling reference to a temporary".  It produces quite a number of
false positives, but for these uses of SfxItemSet::Get it does look 
plausible
that the returned item references could, at least in theory, point at data 
that
is destroyed along with the temporary SfxItemSet.

Change-Id: I11afc4512db488f73170c6cfa706e9e094209550
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142217
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx 
b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index aacb01522f51..ee2f47254765 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1505,8 +1505,7 @@ namespace accessibility
 // NumberingLevel
 if (rRes.Name == "NumberingLevel")
 {
-const SvxNumBulletItem& rNumBullet = 
rCacheTF.GetParaAttribs(GetParagraphIndex()).Get(EE_PARA_NUMBULLET);
-if(rNumBullet.GetNumRule().GetLevelCount()==0)
+
if(rCacheTF.GetParaAttribs(GetParagraphIndex()).Get(EE_PARA_NUMBULLET).GetNumRule().GetLevelCount()==0)
 {
 rRes.Value <<= sal_Int16(-1);
 rRes.Handle = -1;
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx 
b/sc/source/ui/drawfunc/drtxtob.cxx
index ec796f4a8521..5d2e5a2e4019 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -205,7 +205,8 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
 
 case SID_CHARMAP:
 {
-const SvxFontItem& rItem = 
pOutView->GetAttribs().Get(EE_CHAR_FONTINFO);
+auto const attribs = pOutView->GetAttribs();
+const SvxFontItem& rItem = attribs.Get(EE_CHAR_FONTINFO);
 
 OUString aString;
 std::shared_ptr 
aNewItem(std::make_shared(EE_CHAR_FONTINFO));
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 0fd33f62ed6d..bdd0d32d551b 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -383,8 +383,9 @@ void ScEditShell::Execute( SfxRequest& rReq )
 sal_uInt16 nFontWhich = ( nScript == SvtScriptType::ASIAN ) ? 
EE_CHAR_FONTINFO_CJK :
 ( ( nScript == SvtScriptType::COMPLEX ) ? 
EE_CHAR_FONTINFO_CTL :
 
EE_CHAR_FONTINFO );
+auto const attribs = pTableView->GetAttribs();
 const SvxFontItem& rItem = static_cast(
-pTableView->GetAttribs().Get(nFontWhich));
+attribs.Get(nFontWhich));
 
 OUString aString;
 std::shared_ptr 
aNewItem(std::make_shared(EE_CHAR_FONTINFO));
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 3529290162c9..a7e9095ed950 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1490,8 +1490,8 @@ void SdTiledRenderingTest::testTdf102223()
 EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView();
 rEditView.SetSelection(ESelection(0, 0, 0, 3)); // start para, start char, 
end para, end char.
 CPPUNIT_ASSERT_EQUAL(OUString("Red"), rEditView.GetSelected());
-const SvxFontHeightItem& rItem = 
rEditView.GetAttribs().Get(EE_CHAR_FONTHEIGHT);
-CPPUNIT_ASSERT_EQUAL(int(1411), static_cast(rItem.GetHeight()));
+CPPUNIT_ASSERT_EQUAL(
+int(1411), 
static_cast(rEditView.GetAttribs().Get(EE_CHAR_FONTHEIGHT).GetHeight()));
 
 // cut contents of cell
 uno::Sequence aArgs;
@@ -1502,8 +1502,8 @@ void SdTiledRenderingTest::testTdf102223()
 CPPUNIT_ASSERT(pView->GetTextEditObject());
 EditView& rEditView2 = pView->GetTextEditOutlinerView()->GetEditView();
 rEditView2.SetSelection(ESelection(0, 0, 0, 1)); // start para, start 
char, end para, end char.
-const SvxFontHeightItem&

[Libreoffice-commits] core.git: editeng/source sc/source sd/qa sd/source sfx2/source svl/source svx/source sw/qa sw/source

2016-11-16 Thread Noel Grandin
 editeng/source/editeng/editattr.cxx  |2 +-
 editeng/source/editeng/editdoc.cxx   |8 
 editeng/source/editeng/editobj.cxx   |4 ++--
 editeng/source/items/frmitems.cxx|   10 +-
 editeng/source/items/numitem.cxx |4 ++--
 editeng/source/items/textitem.cxx|   12 ++--
 editeng/source/outliner/outliner.cxx |2 +-
 editeng/source/outliner/outlobj.cxx  |2 +-
 editeng/source/outliner/paralist.cxx |4 ++--
 sc/source/core/data/attrib.cxx   |2 +-
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   14 +++---
 sd/source/core/drawdoc.cxx   |2 +-
 sd/source/core/sdpage2.cxx   |2 +-
 sfx2/source/view/viewsh.cxx  |2 +-
 svl/source/items/cenumitm.cxx|2 +-
 svl/source/items/intitem.cxx |2 +-
 svl/source/items/itempool.cxx|2 +-
 svl/source/items/itemset.cxx |2 +-
 svl/source/items/poolitem.cxx|4 ++--
 svl/source/items/stritem.cxx |2 +-
 svl/source/undo/undo.cxx |6 +++---
 svx/source/sdr/properties/defaultproperties.cxx  |2 +-
 svx/source/svdraw/svdmodel.cxx   |2 +-
 svx/source/svdraw/svdobj.cxx |2 +-
 svx/source/svdraw/svdogrp.cxx|2 +-
 svx/source/svdraw/svdpage.cxx|2 +-
 svx/source/svdraw/svdtext.cxx|2 +-
 svx/source/table/cell.cxx|2 +-
 svx/source/table/svdotable.cxx   |4 ++--
 svx/source/table/tablelayouter.cxx   |4 ++--
 svx/source/table/tablemodel.cxx  |2 +-
 svx/source/xoutdev/xattr.cxx |6 +++---
 svx/source/xoutdev/xattr2.cxx|8 
 svx/source/xoutdev/xattrbmp.cxx  |2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |2 +-
 sw/qa/extras/uiwriter/uiwriter.cxx   |8 
 sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx |2 +-
 sw/source/core/crsr/bookmrk.cxx  |4 ++--
 sw/source/core/crsr/crsrsh.cxx   |2 +-
 sw/source/core/crsr/pam.cxx  |4 ++--
 sw/source/core/doc/docbm.cxx |2 +-
 sw/source/core/doc/docfmt.cxx|4 ++--
 sw/source/core/doc/docredln.cxx  |8 
 sw/source/core/doc/fmtcol.cxx|4 ++--
 sw/source/core/doc/number.cxx|4 ++--
 sw/source/core/docnode/nodes.cxx |2 +-
 sw/source/core/docnode/section.cxx   |4 ++--
 sw/source/core/fields/docufld.cxx|2 +-
 sw/source/core/fields/fldbas.cxx |4 ++--
 sw/source/core/layout/atrfrm.cxx |   22 +++---
 sw/source/core/para/paratr.cxx   |2 +-
 sw/source/core/text/xmldump.cxx  |2 +-
 sw/source/core/txtnode/atrfld.cxx|2 +-
 sw/source/core/txtnode/chrfmt.cxx|4 ++--
 sw/source/core/txtnode/fmtatr2.cxx   |2 +-
 sw/source/core/txtnode/ndtxt.cxx |8 
 sw/source/core/txtnode/txatbase.cxx  |2 +-
 sw/source/core/view/viewsh.cxx   |2 +-
 sw/source/uibase/uiview/viewprt.cxx  |2 +-
 sw/source/uibase/utlui/attrdesc.cxx  |4 ++--
 60 files changed, 119 insertions(+), 119 deletions(-)

New commits:
commit 72ffa98e892ad1b64ff3a00b1e26a995cba3076f
Author: Noel Grandin 
Date:   Wed Nov 16 08:59:00 2016 +0200

make the element names in dumpAsXml match the class names

Change-Id: I955facfe3e901fcb76798dab342f96a67d5ac63f
Reviewed-on: https://gerrit.libreoffice.org/30894
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/editattr.cxx 
b/editeng/source/editeng/editattr.cxx
index dbd428b..33dd25b 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -71,7 +71,7 @@ void EditCharAttrib::SetFont( SvxFont&, OutputDevice* )
 
 void EditCharAttrib::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
-xmlTextWriterStartElement(pWriter, BAD_CAST("editCharAttrib"));
+xmlTextWriterStartElement(pWriter, BAD_CAST("EditCharAttrib"));
 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("nStart"), "%d", 
nStart);
 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("nEnd"), "%d", nEnd);
 pItem->dumpAsXml(pWriter);
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index cdc06a8..a7a73ce 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/edit