summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-02-23 13:52:17 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-02-24 12:06:54 +0100
commite80d2ea82edf686bf92a6988c1a194a5fc5649d0 (patch)
treec9e5e4052c751386fdec263a51993fc4d2f627d4
parent8e1dbe2b4b1d36f9994ee23c8d6074d350d17508 (diff)
fdo#45560: Fixed docx textbox borders style and width import
(cherry picked from commits e3e7623bf6cecf0e32912347a58e5a2c7297099d, 2c7a532b7e2b8cf41792292610df96755b131987 and fda2c3639de6b673faf2ccd84b6d4318e592fbf0) Signed-off-by: Miklos Vajna <vmiklos@suse.cz> Conflicts: sw/inc/unoprnms.hxx
-rw-r--r--comphelper/inc/comphelper/TypeGeneration.hxx1
-rw-r--r--comphelper/source/property/TypeGeneration.cxx2
-rwxr-xr-xediteng/inc/editeng/memberids.hrc2
-rw-r--r--editeng/source/items/frmitems.cxx48
-rw-r--r--sw/inc/unoprnms.hxx6
-rw-r--r--sw/source/core/unocore/unoframe.cxx11
-rw-r--r--sw/source/core/unocore/unomap.cxx4
-rw-r--r--sw/source/core/unocore/unoprnms.cxx3
8 files changed, 74 insertions, 3 deletions
diff --git a/comphelper/inc/comphelper/TypeGeneration.hxx b/comphelper/inc/comphelper/TypeGeneration.hxx
index c987b2adbe50..9492ac8ba6fb 100644
--- a/comphelper/inc/comphelper/TypeGeneration.hxx
+++ b/comphelper/inc/comphelper/TypeGeneration.hxx
@@ -71,6 +71,7 @@ namespace comphelper
CPPUTYPE_SEQDEPTXTFLD, //getCppuType( (Sequence<Reference<XDependentTextField> >*)0 )
CPPUTYPE_TXTCNTANCHOR, //getCppuType( (text::TextContentAnchorType*)0 )
CPPUTYPE_WRAPTXTMODE, //getCppuType( (text::WrapTextMode*)0 )
+ CPPUTYPE_LINESTYLE, //getCppuType( (drawing::LineStyle*)0 )
CPPUTYPE_COLORMODE, //getCppuType( (drawing::ColorMode*)0 )
CPPUTYPE_PAGESTYLELAY, //getCppuType( (style::PageStyleLayout*)0 )
CPPUTYPE_VERTALIGN, //getCppuType( (style::VerticalAlignment*)0 )
diff --git a/comphelper/source/property/TypeGeneration.cxx b/comphelper/source/property/TypeGeneration.cxx
index 62c6d0578d91..93c255ca5d62 100644
--- a/comphelper/source/property/TypeGeneration.cxx
+++ b/comphelper/source/property/TypeGeneration.cxx
@@ -128,6 +128,7 @@
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -225,6 +226,7 @@ namespace comphelper
case CPPUTYPE_REFXGRAPHIC: pType = &::getCppuType( (Reference< graphic::XGraphic >*)0); break;
case CPPUTYPE_TABLEBORDERDISTANCES: pType = &::getCppuType( (table::TableBorderDistances*)0 ); break;
case CPPUTPYE_REFEMBEDDEDOBJECT: pType = &embed::XEmbeddedObject::static_type(); break;
+ case CPPUTYPE_LINESTYLE: pType = &::getCppuType( (drawing::LineStyle*)0 ); break;
default:
OSL_FAIL( "Unknown CPPU type" );
}
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 cdf29dee1be1..f01f91e500bc 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>
@@ -1918,6 +1919,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(0);
+ 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 )
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 8df75ee59bfb..40cdc537452f 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -806,7 +806,11 @@ enum SwPropNameIds
/* 0742 */ UNO_NAME_SEPARATOR_LINE_STYLE,
/* 0743 */ UNO_NAME_FOOTNOTE_LINE_STYLE,
/* 0744 */ UNO_NAME_EMBEDDED_OBJECT,
-/* 0745 */ SW_PROPNAME_END
+
+/* 0745 */ UNO_NAME_LINE_STYLE,
+/* 0746 */ UNO_NAME_LINE_WIDTH,
+
+/* 0747 */ SW_PROPNAME_END
// new items in this array must match SwPropNameTab aPropNameTab
};
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 141dabfbe537..21bc5fabcb4b 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -386,8 +386,13 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
GetProperty(RES_BOX, CONVERT_TWIPS|TOP_BORDER_DISTANCE, pTopDistance);
const ::uno::Any* pBottomDistance = 0;
GetProperty(RES_BOX, CONVERT_TWIPS|BOTTOM_BORDER_DISTANCE, pBottomDistance);
+ const ::uno::Any* pLineStyle = 0;
+ GetProperty(RES_BOX, LINE_STYLE, pLineStyle);
+ const ::uno::Any* pLineWidth = 0;
+ GetProperty(RES_BOX, LINE_WIDTH, pLineWidth);
if( pLeft || pRight || pTop || pBottom || pDistance ||
- pLeftDistance || pRightDistance || pTopDistance || pBottomDistance )
+ pLeftDistance || pRightDistance || pTopDistance || pBottomDistance ||
+ pLineStyle || pLineWidth )
{
SvxBoxItem aBox ( static_cast < const :: SvxBoxItem & > ( rFromSet.Get ( RES_BOX ) ) );
if( pLeft )
@@ -408,6 +413,10 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
bRet &= ((SfxPoolItem&)aBox).PutValue(*pTopDistance, CONVERT_TWIPS|TOP_BORDER_DISTANCE);
if( pBottomDistance )
bRet &= ((SfxPoolItem&)aBox).PutValue(*pBottomDistance, CONVERT_TWIPS|BOTTOM_BORDER_DISTANCE);
+ if( pLineStyle )
+ bRet &= ((SfxPoolItem&)aBox).PutValue(*pLineStyle, LINE_STYLE);
+ if( pLineWidth )
+ bRet &= ((SfxPoolItem&)aBox).PutValue(*pLineWidth, LINE_WIDTH|CONVERT_TWIPS);
rToSet.Put(aBox);
}
{
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 1554fdc54016..40aa7dae3bd1 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -348,7 +348,9 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
{ SW_PROP_NMID(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, MID_WRAP_INFLUENCE}, \
{ SW_PROP_NMID(UNO_NAME_TITLE), FN_UNO_TITLE, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, \
{ SW_PROP_NMID(UNO_NAME_DESCRIPTION), FN_UNO_DESCRIPTION, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, \
- { SW_PROP_NMID(UNO_NAME_LAYOUT_SIZE), WID_LAYOUT_SIZE, CPPU_E2T(CPPUTYPE_AWTSIZE), PropertyAttribute::MAYBEVOID | PropertyAttribute::READONLY, 0 },
+ { SW_PROP_NMID(UNO_NAME_LAYOUT_SIZE), WID_LAYOUT_SIZE, CPPU_E2T(CPPUTYPE_AWTSIZE), PropertyAttribute::MAYBEVOID | PropertyAttribute::READONLY, 0 }, \
+ { SW_PROP_NMID(UNO_NAME_LINE_STYLE), RES_BOX, CPPU_E2T(CPPUTYPE_LINESTYLE), 0, LINE_STYLE }, \
+ { SW_PROP_NMID(UNO_NAME_LINE_WIDTH), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, LINE_WIDTH |CONVERT_TWIPS },
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 28e9d48c31fd..2efd7ac6ae03 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -782,6 +782,9 @@ const SwPropNameTab aPropNameTab = {
/* 0743 UNO_NAME_FOOTNOTE_LINE_STYLE */ {MAP_CHAR_LEN("FootnoteLineStyle")},
/* 0744 UNO_NAME_EMBEDDED_OBJECT */ {MAP_CHAR_LEN("EmbeddedObject")},
+/* 0745 UNO_NAME_LINE_STYLE */ {MAP_CHAR_LEN("LineStyle")},
+/* 0746 UNO_NAME_LINE_WIDTH */ {MAP_CHAR_LEN("LineWidth")},
+
// new items in this array must match enum SwPropNameIds
};