summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-01-26 14:03:12 +0100
committerMichael Stahl <mstahl@redhat.com>2012-02-03 22:07:53 +0100
commitff3a6a514d4a95653d111610ea06954b8130a869 (patch)
treea089b434d0e3bb0c9df2abccd24f12e53d0511cd
parent23ca5386808ace4ed73aeabadea44e96d696742b (diff)
cast from BorderLine to BorderLine2 is not valid
Don't access a css::table::BorderLine struct as if it was a css::table::BorderLine2 struct, which it isn't. A proper implementation would need to pass BorderLine2 structs around for which it would need a css::table::TableBorder2 struct that holds BorderLine2 instead of BorderLine, and adapt various places for API compatibility to support both. For now use the default table::BorderLineStyle::SOLID to set the line style at ::editeng::SvxBorderLine This also fixes fdo#39117. (cherry picked from commit 97c66b3b13528cc50f271217663718b3d6681bd9) Signed-off-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 8e7475d10..63ba3efc5 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -61,6 +61,7 @@
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
+#include <com/sun/star/table/BorderLineStyle.hpp>
#include <com/sun/star/sheet/CellFlags.hpp>
#include <com/sun/star/sheet/FormulaResult.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -952,8 +953,7 @@ ScSubTotalFunc lcl_SummaryToSubTotal( sheet::GeneralFunction eSummary )
const ::editeng::SvxBorderLine* ScHelperFunctions::GetBorderLine( ::editeng::SvxBorderLine& rLine, const table::BorderLine& rStruct )
{
// Calc needs Twips, and there are 1/100mm in the Uno structure
- const table::BorderLine2& rBorder2 = static_cast< const table::BorderLine2& >( rStruct );
- rLine.SetStyle( ::editeng::SvxBorderStyle( rBorder2.LineStyle ) );
+ rLine.SetStyle( ::editeng::SvxBorderStyle( table::BorderLineStyle::SOLID ) );
rLine.GuessLinesWidths( rLine.GetStyle(),
(sal_uInt16)HMMToTwips( rStruct.OuterLineWidth ),
(sal_uInt16)HMMToTwips( rStruct.InnerLineWidth ),