[Libreoffice-commits] core.git: 2 commits - editeng/source sw/qa

2018-02-10 Thread Caolán McNamara
 editeng/source/editeng/impedit.hxx |3 ++-
 sw/qa/extras/tiledrendering/tiledrendering.cxx |1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit dcfa2cb4e8f2ce94c5c723efe49961c3b8004c93
Author: Caolán McNamara 
Date:   Fri Feb 9 21:09:36 2018 +

coverity#1401328 Uncaught exception

Change-Id: Idc2363f80026370953f5c48a9d0eeb396a43362c
Reviewed-on: https://gerrit.libreoffice.org/49526
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 1f651ea7f43d..dc5ac2ff01b9 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -56,6 +56,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -225,7 +226,7 @@ class ImpEditView : public vcl::unohelper::DragAndDropClient
 
 private:
 EditView* pEditView;
-std::unique_ptr  pCursor;
+std::unique_ptr  pCursor;
 std::unique_ptrpBackgroundColor;
 /// Containing view shell, if any.
 OutlinerViewShell*mpViewShell;
commit 741ef849587078ca9911514afd4c0ecbdec271cc
Author: Caolán McNamara 
Date:   Fri Feb 9 21:04:24 2018 +

ofz#1429182 Unchecked dynamic_cast

Change-Id: Id070114568cc1cfac2d09c42a8d17f137f5bb075
Reviewed-on: https://gerrit.libreoffice.org/49525
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 7848a877cf41..68fae582f70a 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -2096,6 +2096,7 @@ void SwTiledRenderingTest::testIMESupport()
 SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
 
 SwView* pView = dynamic_cast(SfxViewShell::Current());
+assert(pView);
 SwWrtShell* pWrtShell = pView->GetWrtShellPtr();
 
 // sequence of chinese IME compositions when 'nihao' is typed in an IME
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - editeng/source sw/qa

2014-09-30 Thread Michael Stahl
 editeng/source/items/frmitems.cxx|6 ++
 sw/qa/extras/inc/swmodeltestbase.hxx |   10 --
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |8 +---
 sw/qa/extras/rtfimport/rtfimport.cxx |   13 +++--
 4 files changed, 26 insertions(+), 11 deletions(-)

New commits:
commit 9bb04da4bb18342a107bb843d8054e178d97ae28
Author: Michael Stahl mst...@redhat.com
Date:   Mon Sep 29 23:44:08 2014 +0200

sw: when getting a property value in a unit test, a void result is a bug

Change-Id: Iba0e43c198c3380426d0572427c591f4d77ba09b

diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx 
b/sw/qa/extras/inc/swmodeltestbase.hxx
index fdce9f1..154d18c 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -403,7 +403,10 @@ protected:
 {
 uno::Reference beans::XPropertySet  properties( obj, 
uno::UNO_QUERY_THROW );
 T data = T();
-properties-getPropertyValue( name ) = data;
+if (!(properties-getPropertyValue(name) = data))
+{
+CPPUNIT_FAIL(the property is of unexpected type or void);
+}
 return data;
 }
 
@@ -412,7 +415,10 @@ protected:
 {
 uno::Reference beans::XPropertySet  properties( obj, 
uno::UNO_QUERY_THROW );
 T data = T();
-properties-getPropertyValue( name ) = data;
+if (!(properties-getPropertyValue(name) = data))
+{
+CPPUNIT_FAIL(the property is of unexpected type or void);
+}
 return data;
 }
 
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index eca11e6..fe0241e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2349,9 +2349,11 @@ DECLARE_OOXMLIMPORT_TEST(testBnc519228OddBreaks, 
bnc519228_odd-breaks.docx)
 
 // Page2 comes from follow of style for page 1 and should be a normal 
page. Also check the two page style have the same properties,
 // since page style for page1 was created from page style for page 2.
-OUString page2StyleName = getPropertyOUString( getParagraph( 3, This is 
page 2, which is obviously an even page. ), PageDescName);
-CPPUNIT_ASSERT_EQUAL(OUString(), page2StyleName);
-page2StyleName = getPropertyOUString( page1Style, FollowStyle );
+uno::Any page2StyleAny = uno::Referencebeans::XPropertySet(
+getParagraph(3, This is page 2, which is obviously an even page.),
+uno::UNO_QUERY_THROW)-getPropertyValue(PageDescName);
+CPPUNIT_ASSERT_EQUAL(uno::Any(), page2StyleAny);
+OUString page2StyleName = getPropertyOUString( page1Style, FollowStyle 
);
 uno::Referencebeans::XPropertySet 
page2Style(getStyles(PageStyles)-getByName(page2StyleName), uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_ALL), 
page2Style-getPropertyValue(PageStyleLayout));
 getParagraphOfText( 1, getProperty uno::Referencetext::XText 
(page2Style, HeaderTextLeft), This is the even header);
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 2b2764e..a61d62f 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1536,7 +1536,7 @@ DECLARE_RTFIMPORT_TEST(testFdo68291, fdo68291.odt)
 paste(fdo68291-paste.rtf, xEnd);
 
 // This was Standard, causing an unwanted page break on next paste.
-CPPUNIT_ASSERT_EQUAL(OUString(), getPropertyOUString(getParagraph(1), 
PageDescName));
+CPPUNIT_ASSERT_EQUAL(uno::Any(), 
uno::Referencebeans::XPropertySet(getParagraph(1), 
uno::UNO_QUERY)-getPropertyValue(PageDescName));
 }
 
 DECLARE_RTFIMPORT_TEST(testFdo69384, hello.rtf)
@@ -1630,8 +1630,8 @@ DECLARE_RTFIMPORT_TEST(testContSectionPageBreak, 
cont-section-pagebreak.rtf)
 CPPUNIT_ASSERT_EQUAL(OUString(SECOND), xParaSecond-getString());
 CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE,
  getPropertystyle::BreakType(xParaSecond, 
BreakType));
-CPPUNIT_ASSERT_EQUAL(OUString(),
- getPropertyOUString(xParaSecond, PageDescName));
+CPPUNIT_ASSERT_EQUAL(uno::Any(),
+ uno::Referencebeans::XPropertySet(xParaSecond, 
uno::UNO_QUERY)-getPropertyValue(PageDescName));
 // actually not sure how many paragraph there should be between
 // SECOND and THIRD - important is that the page break is on there
 uno::Referencetext::XTextRange xParaNext = getParagraph(3);
@@ -1642,8 +1642,8 @@ DECLARE_RTFIMPORT_TEST(testContSectionPageBreak, 
cont-section-pagebreak.rtf)
 CPPUNIT_ASSERT_EQUAL(OUString(THIRD), xParaThird-getString());
 CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE,
  getPropertystyle::BreakType(xParaThird, 
BreakType));
-CPPUNIT_ASSERT_EQUAL(OUString(),
- getPropertyOUString(xParaThird, PageDescName));
+CPPUNIT_ASSERT_EQUAL(uno::Any(),
+