summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-04 12:47:02 +0200
committerNoel Grandin <noel@peralex.com>2015-11-04 12:47:39 +0200
commitf927cf4d23432341921c55e6983edf9c8ebe7ff7 (patch)
tree494c7f6547456c7e015c6a3e97f24e9925593668 /sw/qa
parenta66c83d90cdfb8714ef9096d60a60ae807812063 (diff)
loplugin:stringconstant
Change-Id: Ic135382652966e80c288f3407508bdaf0c60316e
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx12
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx10
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx2
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx66
4 files changed, 45 insertions, 45 deletions
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 3e069305baf3..bc7b8983857d 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -256,18 +256,18 @@ DECLARE_ODFIMPORT_TEST(testTdf74524, "tdf74524.odt")
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
uno::Any aField1 = xFields->nextElement();
uno::Reference<lang::XServiceInfo> xServiceInfo1(aField1, uno::UNO_QUERY);
- CPPUNIT_ASSERT(xServiceInfo1->supportsService(OUString("com.sun.star.text.textfield.PageNumber")));
+ CPPUNIT_ASSERT(xServiceInfo1->supportsService("com.sun.star.text.textfield.PageNumber"));
uno::Reference<beans::XPropertySet> xPropertySet(aField1, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_Int16(style::NumberingType::PAGE_DESCRIPTOR)), xPropertySet->getPropertyValue(OUString("NumberingType")));
- CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_Int16(0)), xPropertySet->getPropertyValue(OUString("Offset")));
- CPPUNIT_ASSERT_EQUAL(uno::makeAny(text::PageNumberType_CURRENT), xPropertySet->getPropertyValue(OUString("SubType")));
+ CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_Int16(style::NumberingType::PAGE_DESCRIPTOR)), xPropertySet->getPropertyValue("NumberingType"));
+ CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_Int16(0)), xPropertySet->getPropertyValue("Offset"));
+ CPPUNIT_ASSERT_EQUAL(uno::makeAny(text::PageNumberType_CURRENT), xPropertySet->getPropertyValue("SubType"));
uno::Reference<text::XTextContent> xField1(aField1, uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("1"), xField1->getAnchor()->getString());
uno::Any aField2 = xFields->nextElement();
uno::Reference<lang::XServiceInfo> xServiceInfo2(aField2, uno::UNO_QUERY);
- CPPUNIT_ASSERT(xServiceInfo2->supportsService(OUString("com.sun.star.text.textfield.Annotation")));
+ CPPUNIT_ASSERT(xServiceInfo2->supportsService("com.sun.star.text.textfield.Annotation"));
uno::Reference<beans::XPropertySet> xPropertySet2(aField2, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(uno::makeAny(OUString("Comment 1")), xPropertySet2->getPropertyValue(OUString("Content")));
+ CPPUNIT_ASSERT_EQUAL(uno::makeAny(OUString("Comment 1")), xPropertySet2->getPropertyValue("Content"));
uno::Reference<text::XTextContent> xField2(aField2, uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("Hello 1World"), xField2->getAnchor()->getString());
CPPUNIT_ASSERT(!xFields->hasMoreElements());
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 4e4427c5e22e..d6cd49c585a2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -393,7 +393,7 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx")
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aGrabBag(0);
- xTextDocumentPropertySet->getPropertyValue(OUString("InteropGrabBag")) >>= aGrabBag;
+ xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
bool bTheme = false;
@@ -417,7 +417,7 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xGroup->getCount()); // 1 rendered bitmap from the original shapes
uno::Reference<beans::XPropertySet> xGroupPropertySet(getShape(1), uno::UNO_QUERY);
- xGroupPropertySet->getPropertyValue(OUString("InteropGrabBag")) >>= aGrabBag;
+ xGroupPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
bool bData = false, bLayout = false, bQStyle = false, bColor = false, bDrawing = false;
@@ -508,7 +508,7 @@ DECLARE_OOXMLEXPORT_TEST(testCustomXmlGrabBag, "customxml.docx")
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aGrabBag(0);
- xTextDocumentPropertySet->getPropertyValue(OUString("InteropGrabBag")) >>= aGrabBag;
+ xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
bool CustomXml = false;
for(int i = 0; i < aGrabBag.getLength(); ++i)
@@ -536,7 +536,7 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXGrabBag, "activex.docx")
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aGrabBag(0);
- xTextDocumentPropertySet->getPropertyValue(OUString("InteropGrabBag")) >>= aGrabBag;
+ xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
bool bActiveX = false;
for(int i = 0; i < aGrabBag.getLength(); ++i)
@@ -564,7 +564,7 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXBinGrabBag, "activexbin.docx")
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aGrabBag(0);
- xTextDocumentPropertySet->getPropertyValue(OUString("InteropGrabBag")) >>= aGrabBag;
+ xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
bool bActiveX = false;
for(int i = 0; i < aGrabBag.getLength(); ++i)
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index bf24caade498..7e5eaab3b164 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -142,7 +142,7 @@ public:
args[0].Value <<= OUString("com.sun.star.text.TextDocument");
args[0].State = beans::PropertyState_DIRECT_VALUE;
- uno::Reference<lang::XComponent> xComponent = xLoader->loadComponentFromURL(aURL, OUString("_default"), 0, args);
+ uno::Reference<lang::XComponent> xComponent = xLoader->loadComponentFromURL(aURL, "_default", 0, args);
OUString sMessage = "loading succeeded: " + aURL;
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sMessage, RTL_TEXTENCODING_UTF8).getStr(), !xComponent.is());
}
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index ff1d65ed9388..43da84fa9c62 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -1294,19 +1294,19 @@ void SwUiWriterTest::testTdf77340()
uno::Reference<css::lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
uno::Reference<style::XStyle> xStyle(xFactory->createInstance("com.sun.star.style.ParagraphStyle"), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xPropSet(xStyle, uno::UNO_QUERY_THROW);
- xPropSet->setPropertyValue(OUString("ParaBackColor"), uno::makeAny(sal_Int32(0xFF00FF)));
+ xPropSet->setPropertyValue("ParaBackColor", uno::makeAny(sal_Int32(0xFF00FF)));
uno::Reference<style::XStyleFamiliesSupplier> xSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xNameAccess(xSupplier->getStyleFamilies());
uno::Reference<container::XNameContainer> xNameCont;
xNameAccess->getByName("ParagraphStyles") >>= xNameCont;
- xNameCont->insertByName(OUString("myStyle"), uno::makeAny(xStyle));
+ xNameCont->insertByName("myStyle", uno::makeAny(xStyle));
CPPUNIT_ASSERT_EQUAL(OUString("myStyle"), xStyle->getName());
//Setting the properties with proper values
- xPropSet->setPropertyValue(OUString("PageDescName"), uno::makeAny(OUString("First Page")));
- xPropSet->setPropertyValue(OUString("PageNumberOffset"), uno::makeAny(sal_Int16(3)));
+ xPropSet->setPropertyValue("PageDescName", uno::makeAny(OUString("First Page")));
+ xPropSet->setPropertyValue("PageNumberOffset", uno::makeAny(sal_Int16(3)));
//Getting the properties and checking that they have proper values
- CPPUNIT_ASSERT_EQUAL(uno::makeAny(OUString("First Page")), xPropSet->getPropertyValue(OUString("PageDescName")));
- CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_Int16(3)), xPropSet->getPropertyValue(OUString("PageNumberOffset")));
+ CPPUNIT_ASSERT_EQUAL(uno::makeAny(OUString("First Page")), xPropSet->getPropertyValue("PageDescName"));
+ CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_Int16(3)), xPropSet->getPropertyValue("PageNumberOffset"));
}
void SwUiWriterTest::testTdf79236()
@@ -1417,8 +1417,8 @@ void SwUiWriterTest::testTextSearch()
CPPUNIT_ASSERT_EQUAL(uno::makeAny(float(com::sun::star::awt::FontWeight::BOLD)), aPropVal2[0].Value);
//specifying the search attributes
uno::Reference<beans::XPropertySet> xPropSet(xSearchDes, uno::UNO_QUERY_THROW);
- xPropSet->setPropertyValue(OUString("SearchWords"), uno::makeAny(true));
- xPropSet->setPropertyValue(OUString("SearchCaseSensitive"), uno::makeAny(true));
+ xPropSet->setPropertyValue("SearchWords", uno::makeAny(true));
+ xPropSet->setPropertyValue("SearchCaseSensitive", uno::makeAny(true));
//this will search all the BOLD words
uno::Reference<container::XIndexAccess> xIndex(xSearch->findAll(xSearchDes));
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndex->getCount());
@@ -2174,7 +2174,7 @@ void SwUiWriterTest::testTdf90808()
uno::Reference<text::XText> xText(xTextRange->getText(), uno::UNO_QUERY);
uno::Reference<text::XParagraphCursor> xCrsr(xText->createTextCursor(), uno::UNO_QUERY);
//inserting text into document so that the paragraph is not empty
- xText->setString(OUString("Hello World!"));
+ xText->setString("Hello World!");
uno::Reference<lang::XMultiServiceFactory> xFact(mxComponent, uno::UNO_QUERY);
//creating bookmark 1
uno::Reference<text::XTextContent> xHeadingBookmark1(xFact->createInstance("com.sun.star.text.Bookmark"), uno::UNO_QUERY);
@@ -2274,42 +2274,42 @@ void SwUiWriterTest::testPropertyDefaults()
uno::Reference<beans::XPropertyState> xPropState(xInterface, uno::UNO_QUERY);
//testing CharFontName from style::CharacterProperties
//getting property default
- uno::Any aCharFontName = xPropState->getPropertyDefault(OUString("CharFontName"));
+ uno::Any aCharFontName = xPropState->getPropertyDefault("CharFontName");
//asserting property default and defaults received from "css.text.Defaults" service
- CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue(OUString("CharFontName")), aCharFontName);
+ CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue("CharFontName"), aCharFontName);
//changing the default value
- xPropSet->setPropertyValue(OUString("CharFontName"), uno::makeAny(OUString("Symbol")));
- CPPUNIT_ASSERT_EQUAL(uno::makeAny(OUString("Symbol")), xPropSet->getPropertyValue(OUString("CharFontName")));
+ xPropSet->setPropertyValue("CharFontName", uno::makeAny(OUString("Symbol")));
+ CPPUNIT_ASSERT_EQUAL(uno::makeAny(OUString("Symbol")), xPropSet->getPropertyValue("CharFontName"));
//resetting the value to default
- xPropState->setPropertyToDefault(OUString("CharFontName"));
- CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue(OUString("CharFontName")), aCharFontName);
+ xPropState->setPropertyToDefault("CharFontName");
+ CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue("CharFontName"), aCharFontName);
//testing CharHeight from style::CharacterProperties
//getting property default
- uno::Any aCharHeight = xPropState->getPropertyDefault(OUString("CharHeight"));
+ uno::Any aCharHeight = xPropState->getPropertyDefault("CharHeight");
//asserting property default and defaults received from "css.text.Defaults" service
- CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue(OUString("CharHeight")), aCharHeight);
+ CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue("CharHeight"), aCharHeight);
//changing the default value
- xPropSet->setPropertyValue(OUString("CharHeight"), uno::makeAny(float(14)));
- CPPUNIT_ASSERT_EQUAL(uno::makeAny(float(14)), xPropSet->getPropertyValue(OUString("CharHeight")));
+ xPropSet->setPropertyValue("CharHeight", uno::makeAny(float(14)));
+ CPPUNIT_ASSERT_EQUAL(uno::makeAny(float(14)), xPropSet->getPropertyValue("CharHeight"));
//resetting the value to default
- xPropState->setPropertyToDefault(OUString("CharHeight"));
- CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue(OUString("CharHeight")), aCharHeight);
+ xPropState->setPropertyToDefault("CharHeight");
+ CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue("CharHeight"), aCharHeight);
//testing CharWeight from style::CharacterProperties
- uno::Any aCharWeight = xPropSet->getPropertyValue(OUString("CharWeight"));
+ uno::Any aCharWeight = xPropSet->getPropertyValue("CharWeight");
//changing the default value
- xPropSet->setPropertyValue(OUString("CharWeight"), uno::makeAny(float(awt::FontWeight::BOLD)));
- CPPUNIT_ASSERT_EQUAL(uno::makeAny(float(awt::FontWeight::BOLD)), xPropSet->getPropertyValue(OUString("CharWeight")));
+ xPropSet->setPropertyValue("CharWeight", uno::makeAny(float(awt::FontWeight::BOLD)));
+ CPPUNIT_ASSERT_EQUAL(uno::makeAny(float(awt::FontWeight::BOLD)), xPropSet->getPropertyValue("CharWeight"));
//resetting the value to default
- xPropState->setPropertyToDefault(OUString("CharWeight"));
- CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue(OUString("CharWeight")), aCharWeight);
+ xPropState->setPropertyToDefault("CharWeight");
+ CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue("CharWeight"), aCharWeight);
//testing CharUnderline from style::CharacterProperties
- uno::Any aCharUnderline = xPropSet->getPropertyValue(OUString("CharUnderline"));
+ uno::Any aCharUnderline = xPropSet->getPropertyValue("CharUnderline");
//changing the default value
- xPropSet->setPropertyValue(OUString("CharUnderline"), uno::makeAny(sal_Int16(awt::FontUnderline::SINGLE)));
- CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_Int16(awt::FontUnderline::SINGLE)), xPropSet->getPropertyValue(OUString("CharUnderline")));
+ xPropSet->setPropertyValue("CharUnderline", uno::makeAny(sal_Int16(awt::FontUnderline::SINGLE)));
+ CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_Int16(awt::FontUnderline::SINGLE)), xPropSet->getPropertyValue("CharUnderline"));
//resetting the value to default
- xPropState->setPropertyToDefault(OUString("CharUnderline"));
- CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue(OUString("CharUnderline")), aCharUnderline);
+ xPropState->setPropertyToDefault("CharUnderline");
+ CPPUNIT_ASSERT_EQUAL(xPropSet->getPropertyValue("CharUnderline"), aCharUnderline);
}
void SwUiWriterTest::testTableBackgroundColor()
@@ -2362,7 +2362,7 @@ void SwUiWriterTest::testTdf88899()
uno::Reference<text::XTextField> xTextField(xFact->createInstance("com.sun.star.text.textfield.docinfo.Custom"), uno::UNO_QUERY);
//Setting Name Property
uno::Reference<beans::XPropertySet> xPropSet(xTextField, uno::UNO_QUERY_THROW);
- xPropSet->setPropertyValue(OUString("Name"), uno::makeAny(OUString("dateTime")));
+ xPropSet->setPropertyValue("Name", uno::makeAny(OUString("dateTime")));
//Setting NumberFormat
uno::Reference<util::XNumberFormatsSupplier> xNumberFormatsSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<util::XNumberFormatTypes> xNumFormat(xNumberFormatsSupplier->getNumberFormats(), uno::UNO_QUERY);
@@ -2370,7 +2370,7 @@ void SwUiWriterTest::testTdf88899()
alocale.Language = "en";
alocale.Country = "US";
sal_Int16 key = xNumFormat->getStandardFormat(util::NumberFormat::DATETIME, alocale);
- xPropSet->setPropertyValue(OUString("NumberFormat"), uno::makeAny(sal_Int16(key)));
+ xPropSet->setPropertyValue("NumberFormat", uno::makeAny(sal_Int16(key)));
//Inserting Text Content
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<text::XTextRange> xTextRange(xTextDocument->getText(), uno::UNO_QUERY);