summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-10-31 16:37:57 +0100
committerMichael Stahl <mstahl@redhat.com>2012-10-31 16:41:05 +0100
commit5115050d01ae4abbba18d07300614fad31dacadf (patch)
tree3d71c019cf2b5682a14e367b039bb5be7ccc181e /sw
parent70c3a6be0698e36ff80b7fc590d807ff37aab581 (diff)
convert union SingleLineBorders to struct
MSVC warns about the anonymous struct, and the way we write and read from the union is undefined. Change-Id: I683f54d90393a744e5c94857cd87800bcc8f9ffe
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 816c8d033d70..24618ff472aa 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -404,13 +404,20 @@ void Test::testFdo47669()
CPPUNIT_ASSERT_EQUAL(OUString("http://www.google.com/#a"), getProperty<OUString>(getRun(getParagraph(1), 2), "HyperLinkURL"));
}
-union SingleLineBorders {
+struct SingleLineBorders {
+ sal_Int16 top, bottom, left, right;
SingleLineBorders(int t=0, int b=0, int l=0, int r=0)
: top(t), bottom(b), left(l), right(r) {}
- struct {
- sal_Int16 top, bottom, left, right;
- };
- sal_Int16 sizes[4];
+ sal_Int16 getBorder(int i) const
+ {
+ switch (i) {
+ case 0: return top;
+ case 1: return bottom;
+ case 2: return left;
+ case 3: return right;
+ default: assert(false); return 0;
+ }
+ }
};
void Test::testTableBorders() {
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
@@ -458,7 +465,8 @@ void Test::testTableBorders() {
{
std::stringstream message;
message << cells[i] << "'s " << borderNames[j] << " is incorrect";
- CPPUNIT_ASSERT_EQUAL_MESSAGE(message.str(), borders.sizes[j], aBorderLine.OuterLineWidth);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(message.str(),
+ borders.getBorder(j), aBorderLine.OuterLineWidth);
}
}
}