Kaydet (Commit) ea923cd4 authored tarafından Radek Doulik's avatar Radek Doulik

use com::sun::star::table::BorderLine2 instead of older BorderLine (n#758914)

 - older BorderLine doesn't seem to work in case InnerLineWidth and OuterLineWidth are set to equal positive value and distance is set to 0 (possible regression)
 - using the newer API solves the problem for us

Change-Id: I69f10a0e947352d20b78dbdc39b7c9af95f8603b
üst 803b5513
...@@ -120,7 +120,8 @@ ...@@ -120,7 +120,8 @@
#include <editeng/scripttypeitem.hxx> #include <editeng/scripttypeitem.hxx>
#include "com/sun/star/awt/Gradient.hpp" #include "com/sun/star/awt/Gradient.hpp"
#include <com/sun/star/table/XMergeableCellRange.hpp> #include <com/sun/star/table/XMergeableCellRange.hpp>
#include <com/sun/star/table/BorderLine.hpp> #include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/BorderLineStyle.hpp>
#include <vcl/virdev.hxx> #include <vcl/virdev.hxx>
#include <algorithm> #include <algorithm>
#include <set> #include <set>
...@@ -7305,7 +7306,7 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl ...@@ -7305,7 +7306,7 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl
{ {
SfxItemSet aSet( pLine->GetMergedItemSet() ); SfxItemSet aSet( pLine->GetMergedItemSet() );
XLineStyle eLineStyle(((XLineStyleItem&)pLine->GetMergedItem( XATTR_LINESTYLE )).GetValue()); XLineStyle eLineStyle(((XLineStyleItem&)pLine->GetMergedItem( XATTR_LINESTYLE )).GetValue());
com::sun::star::table::BorderLine aBorderLine; com::sun::star::table::BorderLine2 aBorderLine;
switch( eLineStyle ) switch( eLineStyle )
{ {
case XLINE_DASH : case XLINE_DASH :
...@@ -7313,16 +7314,14 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl ...@@ -7313,16 +7314,14 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl
{ {
Color aLineColor( ((XLineColorItem&)pLine->GetMergedItem( XATTR_LINECOLOR )).GetColorValue() ); Color aLineColor( ((XLineColorItem&)pLine->GetMergedItem( XATTR_LINECOLOR )).GetColorValue() );
aBorderLine.Color = aLineColor.GetColor(); aBorderLine.Color = aLineColor.GetColor();
aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4 ); aBorderLine.LineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4 );
aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4 ); aBorderLine.LineStyle = eLineStyle == XLINE_SOLID ? table::BorderLineStyle::SOLID : table::BorderLineStyle::DASHED;
aBorderLine.LineDistance = 0;
} }
break; break;
case XLINE_NONE : case XLINE_NONE :
{ {
aBorderLine.OuterLineWidth = 0; aBorderLine.LineWidth = 0;
aBorderLine.InnerLineWidth = 0; aBorderLine.LineStyle = table::BorderLineStyle::NONE;
aBorderLine.LineDistance = 0;
} }
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment