From ead5810d62f66443e03f28474e77519e19880ec0 Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Wed, 24 Jul 2013 23:32:54 +0200 Subject: fdo#33617 adapt report engine to incompatible BorderLine2 change Change-Id: I482e4b7b9f056247de3dae247d9328eb672eeba8 Reviewed-on: https://gerrit.libreoffice.org/5086 Reviewed-by: Fridrich Strba Tested-by: Fridrich Strba --- reportdesign/source/filter/xml/xmlCell.cxx | 8 +++++--- reportdesign/source/filter/xml/xmlExport.cxx | 10 +++++++--- reportdesign/source/filter/xml/xmlHelper.cxx | 10 +++++----- 3 files changed, 17 insertions(+), 11 deletions(-) (limited to 'reportdesign/source/filter') diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx index 6a7ad00e66e3..f9554944b7b7 100644 --- a/reportdesign/source/filter/xml/xmlCell.cxx +++ b/reportdesign/source/filter/xml/xmlCell.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "xmlstrings.hrc" #include "xmlTable.hxx" #include "xmlFormattedField.hxx" @@ -228,10 +228,12 @@ void OXMLCell::EndElement() try { pAutoStyle->FillPropertySet(xBorderProp); - table::BorderLine aRight,aLeft; + table::BorderLine2 aRight,aLeft; xBorderProp->getPropertyValue(PROPERTY_BORDERRIGHT) >>= aRight; xBorderProp->getPropertyValue(PROPERTY_BORDERLEFT) >>= aLeft; - xFixedLine->setOrientation( (aRight.OuterLineWidth != 0 || aLeft.OuterLineWidth != 0) ? 1 : 0); + const sal_Int16 rWidth = (aRight.LineWidth == 0) ? aRight.OuterLineWidth : aRight.LineWidth; + const sal_Int16 lWidth = (aLeft.LineWidth == 0) ? aLeft.OuterLineWidth : aLeft.LineWidth; + xFixedLine->setOrientation( (rWidth != 0 || lWidth != 0) ? 1 : 0); } catch(uno::Exception&) { diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 60a93cbf3d89..1b17eec00447 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -48,7 +48,8 @@ #include #include #include -#include +#include +#include #include #include #include "RptDef.hxx" @@ -1174,10 +1175,12 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference xBorderProp = OXMLHelper::createBorderPropertySet(); - table::BorderLine aValue; + table::BorderLine2 aValue; aValue.Color = COL_BLACK; aValue.InnerLineWidth = aValue.LineDistance = 0; aValue.OuterLineWidth = 2; + aValue.LineStyle = table::BorderLineStyle::SOLID; + aValue.LineWidth = 2; awt::Point aPos = xFixedLine->getPosition(); awt::Size aSize = xFixedLine->getSize(); @@ -1220,7 +1223,8 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const ReferencesetPropertyValue(sBorderProp,uno::makeAny(aValue)); - aValue.Color = aValue.OuterLineWidth = 0; + aValue.Color = aValue.OuterLineWidth = aValue.LineWidth = 0; + aValue.LineStyle = table::BorderLineStyle::NONE; uno::Any aEmpty; aEmpty <<= aValue; ::std::for_each(aProps.begin(),aProps.end(), diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx index 75c142706be7..8537f94d3220 100644 --- a/reportdesign/source/filter/xml/xmlHelper.cxx +++ b/reportdesign/source/filter/xml/xmlHelper.cxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -323,10 +323,10 @@ uno::Reference OXMLHelper::createBorderPropertySet() { static comphelper::PropertyMapEntry pMap[] = { - {PROPERTY_BORDERLEFT, static_cast(SAL_N_ELEMENTS(PROPERTY_BORDERLEFT)-1), 0, &::getCppuType((const table::BorderLine*)0) ,PropertyAttribute::BOUND,0}, - {PROPERTY_BORDERRIGHT, static_cast(SAL_N_ELEMENTS(PROPERTY_BORDERRIGHT)-1), 1, &::getCppuType((const table::BorderLine*)0) ,PropertyAttribute::BOUND,0}, - {PROPERTY_BORDERTOP, static_cast(SAL_N_ELEMENTS(PROPERTY_BORDERTOP)-1), 2, &::getCppuType((const table::BorderLine*)0) ,PropertyAttribute::BOUND,0}, - {PROPERTY_BORDERBOTTOM, static_cast(SAL_N_ELEMENTS(PROPERTY_BORDERBOTTOM)-1), 3, &::getCppuType((const table::BorderLine*)0) ,PropertyAttribute::BOUND,0}, + {PROPERTY_BORDERLEFT, static_cast(SAL_N_ELEMENTS(PROPERTY_BORDERLEFT)-1), 0, &::getCppuType((const table::BorderLine2*)0) ,PropertyAttribute::BOUND,0}, + {PROPERTY_BORDERRIGHT, static_cast(SAL_N_ELEMENTS(PROPERTY_BORDERRIGHT)-1), 1, &::getCppuType((const table::BorderLine2*)0) ,PropertyAttribute::BOUND,0}, + {PROPERTY_BORDERTOP, static_cast(SAL_N_ELEMENTS(PROPERTY_BORDERTOP)-1), 2, &::getCppuType((const table::BorderLine2*)0) ,PropertyAttribute::BOUND,0}, + {PROPERTY_BORDERBOTTOM, static_cast(SAL_N_ELEMENTS(PROPERTY_BORDERBOTTOM)-1), 3, &::getCppuType((const table::BorderLine2*)0) ,PropertyAttribute::BOUND,0}, { NULL, 0, 0, NULL, 0, 0 } }; return comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(pMap)); -- cgit v1.2.3