summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-11-26 07:38:27 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-11-26 07:39:39 +0100
commit94dda1701b0b59b0c1faa970035ae81c511519fe (patch)
treec80ffc4694c5753d6244b8e3bc4e8fd46b81fe89 /sw/qa/extras
parent91fff62c87512e16d4f0446c337242e462dc2aec (diff)
sw/qa/extras: default style change name changed
Regression from 2e4f4171d6a29858108922619d680606b633d8f2. Change-Id: Iaaf1cf180458e9b745875aae457e1e3355566385
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/README4
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx2
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx8
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx12
4 files changed, 14 insertions, 12 deletions
diff --git a/sw/qa/extras/README b/sw/qa/extras/README
index 75d45bb38683..261478d854bf 100644
--- a/sw/qa/extras/README
+++ b/sw/qa/extras/README
@@ -98,7 +98,7 @@ more verbose, so the code will look like:
uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xStyles(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xPageStyles(xStyles->getByName("PageStyles"), uno::UNO_QUERY);
-uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
sal_Bool bIsLandscape = sal_False;
xStyle->getPropertyValue("IsLandscape") >>= bIsLandscape;
@@ -238,5 +238,5 @@ uno::Reference<container::XNameAccess> styleFamilies = styleFamiliesSupplier->ge
uno::Reference<container::XNameAccess> pageStyles;
styleFamilies->getByName("PageStyles") >>= pageStyles;
uno::Reference<uno::XInterface> defaultStyle;
-pageStyles->getByName("Default") >>= defaultStyle;
+pageStyles->getByName(DEFAULT_STYLE) >>= defaultStyle;
sal_Int32 width = getProperty< sal_Int32 >( defaultStyle, "Width" );
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 2a7f4d68c7b2..ae0af3db2daf 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -44,6 +44,8 @@
using namespace com::sun::star;
+#define DEFAULT_STYLE "Default Style"
+
/// Base class for filter tests loading or roundtriping a document, then asserting the document model.
class SwModelTestBase : public test::BootstrapFixture, public unotest::MacrosTest
{
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 36fdba3e367a..8071f48cb669 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -272,7 +272,7 @@ void Test::testN750935()
*
* xray ThisComponent.StyleFamilies.PageStyles.Default.FooterIsShared
*/
- uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
sal_Bool bValue = false;
xPropertySet->getPropertyValue("HeaderIsShared") >>= bValue;
CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue);
@@ -533,7 +533,7 @@ xray ThisComponent.StyleFamilies.PageStyles.Default.Width
uno::Reference<container::XNameAccess> pageStyles;
styleFamilies->getByName("PageStyles") >>= pageStyles;
uno::Reference<uno::XInterface> defaultStyle;
- pageStyles->getByName("Default") >>= defaultStyle;
+ pageStyles->getByName(DEFAULT_STYLE) >>= defaultStyle;
uno::Reference<beans::XPropertySet> styleProperties( defaultStyle, uno::UNO_QUERY );
sal_Int32 width = 0;
styleProperties->getPropertyValue( "Width" ) >>= width;
@@ -577,7 +577,7 @@ void Test::testN758883()
*
* xray ThisComponent.StyleFamilies.PageStyles.Default.LeftMargin
*/
- uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
sal_Int32 nValue = 0;
xPropertySet->getPropertyValue("LeftMargin") >>= nValue;
CPPUNIT_ASSERT_EQUAL(sal_Int32(794), nValue);
@@ -667,7 +667,7 @@ void Test::testN693238()
*
* xray ThisComponent.StyleFamilies.PageStyles.Default.LeftMargin ' was 2000, should be 635
*/
- uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
sal_Int32 nValue = 0;
xPropertySet->getPropertyValue("LeftMargin") >>= nValue;
CPPUNIT_ASSERT_EQUAL(sal_Int32(635), nValue);
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index cc2087999b8e..a201c36f30c6 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -446,7 +446,7 @@ void Test::testFdo46955()
void Test::testFdo45394()
{
- uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Default"), "HeaderText");
+ uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(DEFAULT_STYLE), "HeaderText");
OUString aActual = xHeaderText->getString();
// Encoding in the header was wrong.
OUString aExpected("ПК РИК", 11, RTL_TEXTENCODING_UTF8);
@@ -484,7 +484,7 @@ void Test::testFdo44176()
{
uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles"));
uno::Reference<beans::XPropertySet> xFirstPage(xPageStyles->getByName("First Page"), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xDefault(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xDefault(xPageStyles->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
sal_Int32 nFirstTop = 0, nDefaultTop = 0, nDefaultHeader = 0;
xFirstPage->getPropertyValue("TopMargin") >>= nFirstTop;
xDefault->getPropertyValue("TopMargin") >>= nDefaultTop;
@@ -593,7 +593,7 @@ void Test::testN757651()
void Test::testFdo49501()
{
- uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_True, getProperty<sal_Bool>(xStyle, "IsLandscape"));
sal_Int32 nExpected(TWIP_TO_MM100(567));
@@ -668,7 +668,7 @@ void Test::testFdo46966()
*
* xray ThisComponent.StyleFamilies.PageStyles.Default.TopMargin
*/
- uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(720)), getProperty<sal_Int32>(xPropertySet, "TopMargin"));
}
@@ -839,7 +839,7 @@ void Test::testCopyPastePageStyle()
aDescriptor[1].Value <<= sal_False;
xFilter->filter(aDescriptor);
- uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(21001), getProperty<sal_Int32>(xPropertySet, "Width")); // Was letter, i.e. 21590
}
@@ -879,7 +879,7 @@ void Test::testDplinehollow()
void Test::testLeftmarginDefault()
{
// The default left/right margin was incorrect when the top margin was set to zero.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(2540), getProperty<sal_Int32>(getStyles("PageStyles")->getByName("Default"), "LeftMargin"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2540), getProperty<sal_Int32>(getStyles("PageStyles")->getByName(DEFAULT_STYLE), "LeftMargin"));
}
void Test::testDppolyline()