summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:41 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:41 +0100
commit0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d (patch)
treed9b77eece17b7b144a4ea50592b639b9f7c87095 /sw/qa/extras
parent506856ca50e676520bcc80a8b498355663d0388f (diff)
More loplugin:cstylecast: sw
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I0f49d21dfdf82742f11b27709f74294feb1e419e
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx8
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport2.cxx4
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx6
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx2
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx2
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx26
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx6
7 files changed, 27 insertions, 27 deletions
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index f571b66cfbe8..4e57a415e786 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -721,7 +721,7 @@ DECLARE_ODFEXPORT_TEST(testCharacterBorder, "charborder.odt")
// Shadow
const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xSet,"ParaShadowFormat");
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aShadow.Color);
- CPPUNIT_ASSERT_EQUAL(false, (bool)aShadow.IsTransparent);
+ CPPUNIT_ASSERT_EQUAL(false, static_cast<bool>(aShadow.IsTransparent));
CPPUNIT_ASSERT_EQUAL(table::ShadowLocation(0), aShadow.Location);
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), aShadow.ShadowWidth);
}
@@ -751,7 +751,7 @@ DECLARE_ODFEXPORT_TEST(testCharacterBorder, "charborder.odt")
// Shadow
const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xSet,"CharShadowFormat");
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF3333), aShadow.Color);
- CPPUNIT_ASSERT_EQUAL(false, (bool)aShadow.IsTransparent);
+ CPPUNIT_ASSERT_EQUAL(false, static_cast<bool>(aShadow.IsTransparent));
CPPUNIT_ASSERT_EQUAL(table::ShadowLocation(2), aShadow.Location);
CPPUNIT_ASSERT_EQUAL(sal_Int16(280), aShadow.ShadowWidth);
@@ -759,7 +759,7 @@ DECLARE_ODFEXPORT_TEST(testCharacterBorder, "charborder.odt")
{
uno::Reference< style::XAutoStyleFamily > xAutoStyleFamily(getAutoStyles("ParagraphStyles"));
uno::Reference < container::XEnumeration > xAutoStylesEnum( xAutoStyleFamily->createEnumeration() );
- CPPUNIT_ASSERT_EQUAL(true, (bool)xAutoStylesEnum->hasMoreElements());
+ CPPUNIT_ASSERT_EQUAL(true, static_cast<bool>(xAutoStylesEnum->hasMoreElements()));
// First paragraph autostyle
uno::Reference < beans::XPropertySet > xPSet( xAutoStylesEnum->nextElement(), uno::UNO_QUERY );
@@ -818,7 +818,7 @@ DECLARE_ODFEXPORT_TEST(testCharacterBorder, "charborder.odt")
// Shadow
const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xSet,"CharShadowFormat");
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aShadow.Color);
- CPPUNIT_ASSERT_EQUAL(false, (bool)aShadow.IsTransparent);
+ CPPUNIT_ASSERT_EQUAL(false, static_cast<bool>(aShadow.IsTransparent));
CPPUNIT_ASSERT_EQUAL(table::ShadowLocation(3), aShadow.Location);
CPPUNIT_ASSERT_EQUAL(sal_Int16(79), aShadow.ShadowWidth);
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index 1027750aba3f..dfb0a118ebfb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -408,7 +408,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableBorders, "table-borders.docx")
uno::Sequence<OUString> const cells = xTextTable->getCellNames();
sal_Int32 nLength = cells.getLength();
- CPPUNIT_ASSERT_EQUAL((sal_Int32)cellBorders.size(), nLength);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(cellBorders.size()), nLength);
for (sal_Int32 i = 0; i < nLength; ++i)
{
@@ -704,7 +704,7 @@ DECLARE_OOXMLEXPORT_TEST(testWatermarkFont, "watermark-font.docx")
// Check font size
CPPUNIT_ASSERT(xPropertySet->getPropertyValue("CharHeight") >>= nFontSize);
- CPPUNIT_ASSERT_EQUAL((float)72, nFontSize);
+ CPPUNIT_ASSERT_EQUAL(float(72), nFontSize);
}
DECLARE_OOXMLEXPORT_TEST(testFdo43093, "fdo43093.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 458c91652873..fab775935801 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -657,9 +657,9 @@ DECLARE_OOXMLEXPORT_TEST(testFixedDateFields, "fixed-date-field.docx")
// Check fixed property was imported and date value was parsed correctly
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xField, "IsFixed"));
css::util::DateTime date = getProperty<css::util::DateTime>(xField, "DateTimeValue");
- CPPUNIT_ASSERT_EQUAL((sal_uInt16)24, date.Day);
- CPPUNIT_ASSERT_EQUAL((sal_uInt16)7, date.Month);
- CPPUNIT_ASSERT_EQUAL((sal_Int16)2014, date.Year);
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(24), date.Day);
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(7), date.Month);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2014), date.Year);
if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
{
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 98ba60f066cd..6504b0aac42b 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1472,7 +1472,7 @@ DECLARE_RTFEXPORT_TEST(testWatermark, "watermark.rtf")
// Check font size
CPPUNIT_ASSERT(xPropertySet->getPropertyValue("CharHeight") >>= nFontSize);
- CPPUNIT_ASSERT_EQUAL((float)66, nFontSize);
+ CPPUNIT_ASSERT_EQUAL(float(66), nFontSize);
}
DECLARE_RTFEXPORT_TEST(testTdf109790, "tdf109790.rtf")
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 4bed2db8ed28..5949f6f8f7a2 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -42,7 +42,7 @@ static char const DATA_DIRECTORY[] = "/sw/qa/extras/tiledrendering/data/";
static std::ostream& operator<<(std::ostream& os, ViewShellId id)
{
- os << (sal_Int32)id;
+ os << static_cast<sal_Int32>(id);
return os;
}
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 995f905fd7b9..e8bc2ea51aae 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -886,7 +886,7 @@ void SwUiWriterTest::testDOCXAutoTextMultiple()
std::unique_ptr<SwTextBlocks> pGlossary = readDOCXAutotext("autotext-multiple.dotx");
// check entries count
- CPPUNIT_ASSERT_EQUAL((sal_uInt16)3, pGlossary->GetCount());
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), pGlossary->GetCount());
// check names of entries, sorted order
CPPUNIT_ASSERT_EQUAL(OUString("Anothercomplex"), pGlossary->GetLongName(0));
@@ -938,7 +938,7 @@ void SwUiWriterTest::testDOCXAutoTextGallery()
CPPUNIT_ASSERT(pDoc != nullptr);
// check entries count
- CPPUNIT_ASSERT_EQUAL((sal_uInt16)1, pGlossary->GetCount());
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pGlossary->GetCount());
// check entry name (if not contains gallery type)
CPPUNIT_ASSERT_EQUAL(OUString("Multiple"), pGlossary->GetLongName(0));
@@ -953,14 +953,14 @@ void SwUiWriterTest::testWatermarkDOCX()
CPPUNIT_ASSERT(eState >= SfxItemState::DEFAULT);
CPPUNIT_ASSERT(pItem);
- CPPUNIT_ASSERT_EQUAL((unsigned short)SID_WATERMARK, pItem->Which());
+ CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(SID_WATERMARK), pItem->Which());
const SfxWatermarkItem* pWatermark = static_cast<const SfxWatermarkItem*>(pItem);
CPPUNIT_ASSERT_EQUAL(OUString("CustomWatermark"), pWatermark->GetText());
CPPUNIT_ASSERT_EQUAL(OUString("DejaVu Sans Light"), pWatermark->GetFont());
- CPPUNIT_ASSERT_EQUAL((sal_Int16)45, pWatermark->GetAngle());
- CPPUNIT_ASSERT_EQUAL((sal_uInt32)0x548dd4, pWatermark->GetColor());
- CPPUNIT_ASSERT_EQUAL((sal_Int16)50, pWatermark->GetTransparency());
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(45), pWatermark->GetAngle());
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(0x548dd4), pWatermark->GetColor());
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(50), pWatermark->GetTransparency());
}
void SwUiWriterTest::testWatermarkPosition()
@@ -2350,14 +2350,14 @@ void SwUiWriterTest::testSearchWithTransliterate()
sal_uLong case1 = pWrtShell->SearchPattern(SearchOpt,true,SwDocPositions::Start,SwDocPositions::End);
SwShellCursor* pShellCursor = pWrtShell->getShellCursor(true);
CPPUNIT_ASSERT_EQUAL(OUString(),pShellCursor->GetText());
- CPPUNIT_ASSERT_EQUAL(0,(int)case1);
+ CPPUNIT_ASSERT_EQUAL(0,static_cast<int>(case1));
SearchOpt.searchString = "paragraph";
SearchOpt.transliterateFlags = TransliterationFlags::IGNORE_KASHIDA_CTL;
//transliteration option set so that all search strings are found
sal_uLong case2 = pWrtShell->SearchPattern(SearchOpt,true,SwDocPositions::Start,SwDocPositions::End);
pShellCursor = pWrtShell->getShellCursor(true);
CPPUNIT_ASSERT_EQUAL(OUString("paragraph"),pShellCursor->GetText());
- CPPUNIT_ASSERT_EQUAL(1,(int)case2);
+ CPPUNIT_ASSERT_EQUAL(1,static_cast<int>(case2));
}
void SwUiWriterTest::testTdf73660()
@@ -3680,13 +3680,13 @@ void SwUiWriterTest::testTdf90883TableBoxGetCoordinates()
pWrtShell->Down(true);
SwSelBoxes aBoxes;
::GetTableSel( *pWrtShell, aBoxes );
- CPPUNIT_ASSERT_EQUAL( 2, (int)aBoxes.size() );
+ CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(aBoxes.size()) );
Point pos ( aBoxes[0]->GetCoordinates() );
- CPPUNIT_ASSERT_EQUAL( 1, (int)pos.X() );
- CPPUNIT_ASSERT_EQUAL( 1, (int)pos.Y() );
+ CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(pos.X()) );
+ CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(pos.Y()) );
pos = aBoxes[1]->GetCoordinates();
- CPPUNIT_ASSERT_EQUAL( 1, (int)pos.X() );
- CPPUNIT_ASSERT_EQUAL( 2, (int)pos.Y() );
+ CPPUNIT_ASSERT_EQUAL( 1, static_cast<int>(pos.X()) );
+ CPPUNIT_ASSERT_EQUAL( 2, static_cast<int>(pos.Y()) );
}
void SwUiWriterTest::testEmbeddedDataSource()
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index 0695c309951b..3d977881c677 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -270,8 +270,8 @@ DECLARE_WW8EXPORT_TEST(testTdf91687, "tdf91687.doc")
// Exported Watermarks were resized
uno::Reference<drawing::XShape> xWatermark = getShape(1);
- CPPUNIT_ASSERT_EQUAL((sal_Int32)5172, xWatermark->getSize().Height);
- CPPUNIT_ASSERT_EQUAL((sal_Int32)18105, xWatermark->getSize().Width);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(5172), xWatermark->getSize().Height);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(18105), xWatermark->getSize().Width);
}
DECLARE_WW8EXPORT_TEST(testTdf114308, "tdf114308.doc")
@@ -279,7 +279,7 @@ DECLARE_WW8EXPORT_TEST(testTdf114308, "tdf114308.doc")
// Watermark with no additional padding
uno::Reference<drawing::XShape> xWatermark = getShape(1);
- CPPUNIT_ASSERT_EQUAL((sal_Int32)8729, xWatermark->getSize().Height);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(8729), xWatermark->getSize().Height);
}
DECLARE_WW8EXPORT_TEST(testTdf111480, "tdf111480.doc")