[Libreoffice-commits] .: 4 commits - comphelper/inc comphelper/source editeng/inc editeng/source oox/source sw/inc sw/source writerfilter/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Thu Feb 23 04:55:46 PST 2012


 comphelper/inc/comphelper/TypeGeneration.hxx      |    1 
 comphelper/source/property/TypeGeneration.cxx     |    2 
 editeng/inc/editeng/memberids.hrc                 |    2 
 editeng/source/items/frmitems.cxx                 |   48 ++++++++++++++++++++++
 oox/source/vml/vmldrawing.cxx                     |   26 ++++++++++-
 sw/inc/unoprnms.hxx                               |    6 ++
 sw/source/core/layout/paintfrm.cxx                |    3 -
 sw/source/core/unocore/unoframe.cxx               |   13 +++++
 sw/source/core/unocore/unomap.cxx                 |    4 +
 sw/source/core/unocore/unoprnms.cxx               |    3 +
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    3 -
 11 files changed, 98 insertions(+), 13 deletions(-)

New commits:
commit e3e7623bf6cecf0e32912347a58e5a2c7297099d
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Thu Feb 23 13:52:17 2012 +0100

    fdo#45560: Fixed docx textbox borders style and width import

diff --git a/comphelper/inc/comphelper/TypeGeneration.hxx b/comphelper/inc/comphelper/TypeGeneration.hxx
index c987b2a..9492ac8 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 62c6d05..93c255c 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 fa57ab1..b53276c 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 50484b8..b10218d 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 )
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index e70963a..8114f91 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -808,7 +808,11 @@ enum SwPropNameIds
 /* 0744 */  UNO_NAME_EMBEDDED_OBJECT,
 /* 0745 */  UNO_NAME_RSID,
 /* 0746 */  UNO_NAME_PARRSID,
-/* 0747 */  SW_PROPNAME_END
+
+/* 0747 */  UNO_NAME_LINE_STYLE,
+/* 0748 */  UNO_NAME_LINE_WIDTH,
+
+/* 0749 */  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 ebf73ac..60e66fc 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -385,8 +385,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 )
@@ -407,6 +412,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);
     }
     {
@@ -2386,7 +2395,7 @@ awt::Point SwXFrame::getPosition(void) throw( uno::RuntimeException )
     throw aRuntime;
 }
 
-void SwXFrame::setPosition(const awt::Point& /*aPosition*/) throw( uno::RuntimeException )
+void SwXFrame::setPosition(const awt::Point& aPosition) throw( uno::RuntimeException )
 {
     SolarMutexGuard aGuard;
     uno::RuntimeException aRuntime;
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 4e6a17c..ca85a18 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -350,7 +350,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 0c0479c..a3f84d4 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -784,6 +784,9 @@ const SwPropNameTab aPropNameTab = {
 /* 0745 UNO_NAME_RSID */	         {MAP_CHAR_LEN("Rsid")},
 /* 0746 UNO_NAME_PARRSID */	         {MAP_CHAR_LEN("ParRsid")},
 
+/* 0747 UNO_NAME_LINE_STYLE */	         {MAP_CHAR_LEN("LineStyle")},
+/* 0748 UNO_NAME_LINE_WIDTH */	         {MAP_CHAR_LEN("LineWidth")},
+
 // new items in this array must match enum SwPropNameIds
 };
 
commit 94698d89f675da9b4da1143fa150bbd76def6ccf
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Thu Feb 23 13:51:21 2012 +0100

    fdo#45560: Fixed docx textbox position and size import

diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index 8c6207f..1a3530d 100644
--- a/oox/source/vml/vmldrawing.cxx
+++ b/oox/source/vml/vmldrawing.cxx
@@ -29,9 +29,13 @@
 #include "oox/vml/vmldrawing.hxx"
 
 #include <algorithm>
+#include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/drawing/XControlShape.hpp>
 #include <com/sun/star/drawing/XShapes.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/text/HoriOrientation.hpp>
+#include <com/sun/star/text/VertOrientation.hpp>
+#include <rtl/oustringostreaminserter.hxx>
 #include "oox/core/xmlfilterbase.hxx"
 #include "oox/helper/containerhelper.hxx"
 #include "oox/ole/axcontrol.hxx"
@@ -44,8 +48,10 @@ namespace vml {
 // ============================================================================
 
 using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::drawing;
 using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::text;
 using namespace ::com::sun::star::uno;
 
 using ::oox::core::XmlFilterBase;
@@ -217,13 +223,25 @@ Reference< XShape > Drawing::createAndInsertXShape( const OUString& rService,
     {
         Reference< XMultiServiceFactory > xModelFactory( mrFilter.getModelFactory(), UNO_SET_THROW );
         xShape.set( xModelFactory->createInstance( rService ), UNO_QUERY_THROW );
-        // insert shape into passed shape collection (maybe drawpage or group shape)
-        rxShapes->add( xShape );
-        xShape->setPosition( Point( rShapeRect.X, rShapeRect.Y ) );
+        if ( !rService.equalsAscii( "com.sun.star.text.TextFrame" ) )
+        {
+            // insert shape into passed shape collection (maybe drawpage or group shape)
+            rxShapes->add( xShape );
+            xShape->setPosition( Point( rShapeRect.X, rShapeRect.Y ) );
+        }
+        else
+        {
+            Reference< XPropertySet > xPropSet( xShape, UNO_QUERY_THROW );
+            xPropSet->setPropertyValue( OUString::createFromAscii( "HoriOrient" ), makeAny( HoriOrientation::NONE ) );
+            xPropSet->setPropertyValue( OUString::createFromAscii( "VertOrient" ), makeAny( VertOrientation::NONE ) );
+            xPropSet->setPropertyValue( OUString::createFromAscii( "HoriOrientPosition" ), makeAny( rShapeRect.X ) );
+            xPropSet->setPropertyValue( OUString::createFromAscii( "VertOrientPosition" ), makeAny( rShapeRect.Y ) );
+        }
         xShape->setSize( Size( rShapeRect.Width, rShapeRect.Height ) );
     }
-    catch( Exception& )
+    catch( Exception& e )
     {
+        SAL_WARN( "oox", "Drawing::createAndInsertXShape - error during shape object creation: " << e.Message );
     }
     OSL_ENSURE( xShape.is(), "Drawing::createAndInsertXShape - cannot instanciate shape object" );
     return xShape;
commit f0a0b8fb67f76dd91ac2e28f67620d2e026cf4be
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Tue Feb 21 15:04:24 2012 +0100

    removed remaining #if DEBUG

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index ebd00d2..d775650 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1055,9 +1055,6 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
                     uno::Reference< text::XTextContent > xObj = m_aAnchoredStack.top( );
                     try
                     {
-#if DEBUG
-                        rtl::OUString sText( xTextRange->getString( ) );
-#endif
                         xObj->attach( xTextRange );
                     }
                     catch ( uno::RuntimeException& )
commit b86ea3948d5a8d43a385ba5851386d8f1daac8c2
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Tue Feb 21 09:40:38 2012 +0100

    Make column breaks indicator independent of meta-char viewing

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index ba89741..615c7fc 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3396,8 +3396,7 @@ void SwColumnFrm::PaintBreak( ) const
                 //    * Non-printing characters are shown, as this is more consistent
                 //      with other formatting marks
                 if ( !pGlobalShell->IsShowHeaderFooterSeparator( Header ) &&
-                     !pGlobalShell->IsShowHeaderFooterSeparator( Footer ) &&
-                      pGlobalShell->GetViewOptions( )->IsLineBreak( ) )
+                     !pGlobalShell->IsShowHeaderFooterSeparator( Footer ) )
                 {
                     SwRect aRect( pCnt->Prt() );
                     aRect.Pos() += pCnt->Frm().Pos();


More information about the Libreoffice-commits mailing list