diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-02-23 13:52:17 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-02-23 13:56:24 +0100 |
commit | e3e7623bf6cecf0e32912347a58e5a2c7297099d (patch) | |
tree | 4604956e18b9efaad547c76705a682ccb8ae2398 /editeng | |
parent | 94698d89f675da9b4da1143fa150bbd76def6ccf (diff) |
fdo#45560: Fixed docx textbox borders style and width import
Diffstat (limited to 'editeng')
-rwxr-xr-x | editeng/inc/editeng/memberids.hrc | 2 | ||||
-rw-r--r-- | editeng/source/items/frmitems.cxx | 48 |
2 files changed, 50 insertions, 0 deletions
diff --git a/editeng/inc/editeng/memberids.hrc b/editeng/inc/editeng/memberids.hrc index fa57ab11793a..b53276ccb6e2 100755 --- a/editeng/inc/editeng/memberids.hrc +++ b/editeng/inc/editeng/memberids.hrc @@ -168,6 +168,8 @@ #define MID_RIGHT_BORDER 11 #define MID_TOP_BORDER 12 #define MID_BOTTOM_BORDER 13 +#define LINE_STYLE 14 +#define LINE_WIDTH 15 //BrushItem #define MID_BACK_COLOR 0 diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 50484b832df9..b10218d770b3 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -29,6 +29,7 @@ // include --------------------------------------------------------------- #include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/script/XTypeConverter.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/table/ShadowLocation.hpp> @@ -1920,6 +1921,53 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case MID_TOP_BORDER: nLine = BOX_LINE_TOP; break; + case LINE_STYLE: + { + drawing::LineStyle eDrawingStyle; + rVal >>= eDrawingStyle; + editeng::SvxBorderStyle eBorderStyle = editeng::NO_STYLE; + switch ( eDrawingStyle ) + { + default: + case drawing::LineStyle_NONE: + eBorderStyle = editeng::NO_STYLE; + break; + case drawing::LineStyle_SOLID: + eBorderStyle = editeng::SOLID; + break; + case drawing::LineStyle_DASH: + eBorderStyle = editeng::DASHED; + break; + } + + // Set the line style on all borders + const sal_uInt16 aBorders[] = { BOX_LINE_LEFT, BOX_LINE_RIGHT, BOX_LINE_BOTTOM, BOX_LINE_TOP }; + for (int n(0); n != SAL_N_ELEMENTS(aBorders); ++n) + { + editeng::SvxBorderLine* pLine = const_cast< editeng::SvxBorderLine* >( GetLine( aBorders[n] ) ); + pLine->SetStyle( eBorderStyle ); + } + return sal_True; + } + break; + case LINE_WIDTH: + { + // Set the line width on all borders + long nWidth; + rVal >>= nWidth; + if( bConvert ) + nWidth = MM100_TO_TWIP( nWidth ); + + // Set the line Width on all borders + const sal_uInt16 aBorders[] = { BOX_LINE_LEFT, BOX_LINE_RIGHT, BOX_LINE_BOTTOM, BOX_LINE_TOP }; + for (int n(0); n != SAL_N_ELEMENTS(aBorders); ++n) + { + editeng::SvxBorderLine* pLine = const_cast< editeng::SvxBorderLine* >( GetLine( aBorders[n] ) ); + pLine->SetWidth( nWidth ); + } + } + return sal_True; + break; } if( bDistMember || nMemberId == BORDER_DISTANCE ) |