diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-15 09:44:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-15 13:46:29 +0200 |
commit | 718cdd43c25783d9cd402e381123efe3981cc514 (patch) | |
tree | e8c4c20b8173f15520724a3d3e216bfbe0e98851 /sw | |
parent | 4cd418692ed71e31fdf2fbd85cef89aa29df55c9 (diff) |
loplugin:redundantcast, find more functional casts
In the enum types that caused the problem look like this when I dump
then:
EnumType 0xdb45770 'enum SvxFrameDirection'
`-Enum 0xdb456d8 'SvxFrameDirection'
SubstTemplateTypeParmType 0xdb61200 'enum SvxFrameDirection' sugar
|-TemplateTypeParmType 0xd7518f0 'EnumT' dependent depth 0 index 0
| `-TemplateTypeParm 0xd7518a8 'EnumT'
`-EnumType 0xdb45770 'enum SvxFrameDirection'
`-Enum 0xdb456d8 'SvxFrameDirection'
Change-Id: Id8fedabe43b7a27df61a2320a9acbf54d2dc7882
Reviewed-on: https://gerrit.libreoffice.org/41169
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 6 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 10 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 10 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 10 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport2.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 2 |
10 files changed, 27 insertions, 27 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index 890426bb7b57..aa06dda59012 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -620,7 +620,7 @@ DECLARE_OOXMLEXPORT_TEST(testI120928, "i120928.docx") DECLARE_OOXMLEXPORT_TEST(testFdo64826, "fdo64826.docx") { // 'Track-Changes' (Track Revisions) wasn't exported. - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(mxComponent, "RecordChanges"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(mxComponent, "RecordChanges")); } DECLARE_OOXMLEXPORT_TEST(testPageBackground, "page-background.docx") @@ -789,7 +789,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo56679, "fdo56679.docx") uno::Reference< text::XTextRange > xParagraph = getParagraph( 1 ); uno::Reference< text::XTextRange > xText = getRun( xParagraph, 2, "This is a simple sentence."); - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xText, "CharUnderlineHasColor"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xText, "CharUnderlineHasColor")); CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), getProperty<sal_Int32>(xText, "CharUnderlineColor")); } @@ -1089,7 +1089,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo67737, "fdo67737.docx") const beans::PropertyValue& rProp = aProps[i]; if (rProp.Name == "MirroredY") { - CPPUNIT_ASSERT_EQUAL( true, bool(rProp.Value.get<bool>()) ); + CPPUNIT_ASSERT_EQUAL( true, rProp.Value.get<bool>() ); return; } } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 4287154d76d6..e7a569cd5090 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -121,8 +121,8 @@ DECLARE_OOXMLEXPORT_TEST(testGroupshapePicture, "groupshape-picture.docx") DECLARE_OOXMLEXPORT_TEST(testAutofit, "autofit.docx") { - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(getShape(1), "TextAutoGrowHeight"))); - CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<bool>(getShape(2), "TextAutoGrowHeight"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getShape(1), "TextAutoGrowHeight")); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getShape(2), "TextAutoGrowHeight")); } DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index b1ba0db8cfc0..d564e8031b26 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -633,22 +633,22 @@ DECLARE_OOXMLEXPORT_TEST(test77219, "test77219.docx") DECLARE_OOXMLEXPORT_TEST(testTdf77219_backgroundShape, "tdf77219_backgroundShape.docx") { - CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", false, bool(getProperty<bool>(getShape(1), "Opaque"))); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", false, getProperty<bool>(getShape(1), "Opaque")); } DECLARE_OOXMLEXPORT_TEST(testTdf77219_foregroundShape, "tdf77219_foregroundShape.docx") { - CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", true, bool(getProperty<bool>(getShape(1), "Opaque"))); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", true, getProperty<bool>(getShape(1), "Opaque")); } DECLARE_OOXMLEXPORT_TEST(testTdf108973_backgroundTextbox, "tdf108973_backgroundTextbox.docx") { - CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox is in front of the paragraph", false, bool(getProperty<bool>(getShape(1), "Opaque"))); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox is in front of the paragraph", false, getProperty<bool>(getShape(1), "Opaque")); } DECLARE_OOXMLEXPORT_TEST(testTdf108973_foregroundTextbox, "tdf108973_foregroundTextbox.docx") { - CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox is in front of the paragraph", true, bool(getProperty<bool>(getShape(1), "Opaque"))); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox is in front of the paragraph", true, getProperty<bool>(getShape(1), "Opaque")); } DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx") @@ -922,7 +922,7 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79591, "fdo79591.docx") DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx") { // The problem was that the shape in the header wasn't in the background. - CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<bool>(getShape(1), "Opaque"))); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getShape(1), "Opaque")); } DECLARE_OOXMLEXPORT_TEST(testFdo80894, "TextFrameRotation.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 17afb75359fe..c59fb365146f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -940,7 +940,7 @@ DECLARE_OOXMLEXPORT_TEST(testN779630, "n779630.docx") CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.DateField"))); CPPUNIT_ASSERT_EQUAL(OUString("date default text"), getProperty<OUString>(xPropertySet, "HelpText")); CPPUNIT_ASSERT_EQUAL(sal_Int16(8), getProperty<sal_Int16>(xPropertySet, "DateFormat")); - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xPropertySet, "Dropdown"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPropertySet, "Dropdown")); // Second shape: combo box xControlShape.set(getShape(2), uno::UNO_QUERY); @@ -949,7 +949,7 @@ DECLARE_OOXMLEXPORT_TEST(testN779630, "n779630.docx") CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.ComboBox"))); CPPUNIT_ASSERT_EQUAL(OUString("dropdown default text"), getProperty<OUString>(xPropertySet, "DefaultText")); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty< uno::Sequence<OUString> >(xPropertySet, "StringItemList").getLength()); - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xPropertySet, "Dropdown"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPropertySet, "Dropdown")); } DECLARE_OOXMLEXPORT_TEST(testIndentation, "indentation.docx") @@ -1223,9 +1223,9 @@ DECLARE_OOXMLEXPORT_TEST(testWpsOnly, "wps-only.docx") CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGHT, getProperty<text::WrapTextMode>(xShape, "Surround")); // This should be in front of text. - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xShape, "Opaque"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xShape, "Opaque")); // And this should be behind the document. - CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<bool>(getShape(2), "Opaque"))); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getShape(2), "Opaque")); } DECLARE_OOXMLEXPORT_TEST(testWpgOnly, "wpg-only.docx") @@ -1252,7 +1252,7 @@ DECLARE_OOXMLEXPORT_TEST(textboxWpgOnly, "textbox-wpg-only.docx") CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "HoriOrientRelation")); CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "VertOrientRelation")); // Make sure the shape is not in the background, as we have behindDoc="0" in the doc. - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xShape, "Opaque"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xShape, "Opaque")); // The 3 paragraphs on the rectangles inside the groupshape ended up in the // body text, make sure we don't have multiple paragraphs there anymore. diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 32b87b2caff8..796f1234dd3e 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -571,7 +571,7 @@ DECLARE_OOXMLIMPORT_TEST(testTableWidth, "table_width.docx") uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); // Relative width wasn't recognized during import. - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xTables->getByIndex(0), "IsWidthRelative"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTables->getByIndex(0), "IsWidthRelative")); uno::Reference<text::XTextFramesSupplier> xFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xFrames(xFramesSupplier->getTextFrames(), uno::UNO_QUERY); @@ -780,7 +780,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf48658_transparentOLEheader, "tdf48658_transparen { // The problem was that the shape in the header was hidden in the background. // The round-tripped document was always fine (even before the fix) but the shape numbers change, so import-only test. - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(getShape(1), "Opaque"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getShape(1), "Opaque")); } DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeParaAdjust, "dml-groupshape-paraadjust.docx") @@ -1412,10 +1412,10 @@ DECLARE_OOXMLIMPORT_TEST(testTdf109306, "tdf109306.docx") uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); // Both types of relative width specification (pct): simple integers (in fiftieths of percent) // and floats with "%" unit specification must be treated correctly - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xTables->getByIndex(0), "IsWidthRelative"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTables->getByIndex(0), "IsWidthRelative")); CPPUNIT_ASSERT_EQUAL(sal_Int16(90), getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth")); - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xTables->getByIndex(1), "IsWidthRelative"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTables->getByIndex(1), "IsWidthRelative")); CPPUNIT_ASSERT_EQUAL(sal_Int16(80), getProperty<sal_Int16>(xTables->getByIndex(1), "RelativeWidth")); } @@ -1427,7 +1427,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf109524, "tdf109524.docx") // Until it's correctly implemented, we assign it 100% relative width. // Previously, the table (without explicitly set width) had huge actual width // and extended far outside of page's right border. - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xTables->getByIndex(0), "IsWidthRelative"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTables->getByIndex(0), "IsWidthRelative")); CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth")); } diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 9f3b558e5bdb..0d5efe90272c 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -707,7 +707,7 @@ DECLARE_RTFEXPORT_TEST(testLineNumbering, "linenumbering.rtf") { uno::Reference<text::XLineNumberingProperties> xLineNumberingProperties(mxComponent, uno::UNO_QUERY_THROW); uno::Reference<beans::XPropertySet> xPropertySet = xLineNumberingProperties->getLineNumberingProperties(); - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xPropertySet, "IsOn"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPropertySet, "IsOn")); CPPUNIT_ASSERT_EQUAL(sal_Int32(5), getProperty<sal_Int32>(xPropertySet, "Interval")); } diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index 034f32c2de26..0e394ca11dfa 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -187,8 +187,8 @@ DECLARE_RTFEXPORT_TEST(testN750757, "n750757.rtf") uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); - CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<bool>(xParaEnum->nextElement(), "ParaContextMargin"))); - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xParaEnum->nextElement(), "ParaContextMargin"))); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xParaEnum->nextElement(), "ParaContextMargin")); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xParaEnum->nextElement(), "ParaContextMargin")); } DECLARE_RTFEXPORT_TEST(testFdo45563, "fdo45563.rtf") diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index cabe33795880..6a869b7a9113 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -649,8 +649,8 @@ DECLARE_RTFIMPORT_TEST(testContSectionPageBreak, "cont-section-pagebreak.rtf") DECLARE_RTFIMPORT_TEST(testBackground, "background.rtf") { // The first shape wasn't in the foreground. - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(getShape(1), "Opaque"))); - CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<bool>(getShape(2), "Opaque"))); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getShape(1), "Opaque")); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getShape(2), "Opaque")); } DECLARE_RTFIMPORT_TEST(testFdo74823, "fdo74823.rtf") diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 003c12a6e0d8..c44f68f78eb9 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -814,7 +814,7 @@ DECLARE_WW8EXPORT_TEST(testFdo42144, "fdo42144.odt") { // Footer wasn't disabled -- instead empty footer was exported. uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<bool>(xStyle, "FooterIsOn"))); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStyle, "FooterIsOn")); } DECLARE_WW8EXPORT_TEST(testCharacterBorder, "charborder.odt") diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 721bf51d5479..a478de201ac0 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -430,7 +430,7 @@ SwFormatFillOrder::SwFormatFillOrder( SwFillOrder nFO ) {} SfxPoolItem* SwFormatFillOrder::Clone( SfxItemPool* ) const { - return new SwFormatFillOrder( SwFillOrder(GetValue()) ); + return new SwFormatFillOrder( GetValue() ); } sal_uInt16 SwFormatFillOrder::GetValueCount() const |