[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - 2 commits - xmloff/inc xmloff/source

Radek Doulik rodo at novell.com
Fri Apr 5 07:48:37 PDT 2013


 xmloff/inc/EnhancedCustomShapeToken.hxx         |    2 
 xmloff/inc/xmloff/xmltoken.hxx                  |    1 
 xmloff/source/core/xmltoken.cxx                 |    1 
 xmloff/source/draw/EnhancedCustomShapeToken.cxx |    2 
 xmloff/source/draw/shapeexport4.cxx             |   42 ++++++++++++++
 xmloff/source/draw/ximpcustomshape.cxx          |   68 ++++++++++++++++++++++++
 6 files changed, 116 insertions(+)

New commits:
commit 7ec5d3c8080862bb94f8efe5ee0bf688ba78d82f
Author: Radek Doulik <rodo at novell.com>
Date:   Fri Feb 1 12:25:23 2013 +0100

    export darken/darkeless/lighten/lightenless commands
    
    Change-Id: I4531ab82a52e3da41f12409185f7c0730381aa23

diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx
index 1bb5481..ce504fe 100644
--- a/xmloff/source/draw/shapeexport4.cxx
+++ b/xmloff/source/draw/shapeexport4.cxx
@@ -413,6 +413,30 @@ void ImpExportEnhancedPath( SvXMLExport& rExport,
                     i += 2;
                 }
                 break;
+            case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::DARKEN :
+                if ( bExtended )
+                    aStrBuffer.append( (sal_Unicode)'H' );
+                else
+                    bNeedExtended = true;
+                break;
+            case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::DARKENLESS :
+                if ( bExtended )
+                    aStrBuffer.append( (sal_Unicode)'I' );
+                else
+                    bNeedExtended = true;
+                break;
+            case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::LIGHTEN :
+                if ( bExtended )
+                    aStrBuffer.append( (sal_Unicode)'J' );
+                else
+                    bNeedExtended = true;
+                break;
+            case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::LIGHTENLESS :
+                if ( bExtended )
+                    aStrBuffer.append( (sal_Unicode)'K' );
+                else
+                    bNeedExtended = true;
+                break;
             default : // ups, seems to be something wrong
             {
                 aSegment.Count = 1;
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index a3406ed..1a280ef 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -702,6 +702,34 @@ void GetEnhancedPath( std::vector< com::sun::star::beans::PropertyValue >& rDest
                 nIndex++;
             }
             break;
+            case 'H' :
+            {
+                nLatestSegmentCommand = com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::DARKEN;
+                nParametersNeeded = 0;
+                nIndex++;
+            }
+            break;
+            case 'I' :
+            {
+                nLatestSegmentCommand = com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::DARKENLESS;
+                nParametersNeeded = 0;
+                nIndex++;
+            }
+            break;
+            case 'J' :
+            {
+                nLatestSegmentCommand = com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::LIGHTEN;
+                nParametersNeeded = 0;
+                nIndex++;
+            }
+            break;
+            case 'K' :
+            {
+                nLatestSegmentCommand = com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::LIGHTENLESS;
+                nParametersNeeded = 0;
+                nIndex++;
+            }
+            break;
             case 'W' :
             {
                 nLatestSegmentCommand = com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO;
commit 7c5d35a66ef78837aa6fdc02eea723ce8ef012fa
Author: Radek Doulik <rodo at novell.com>
Date:   Thu Jan 31 12:05:50 2013 +0100

    export subpath sizes (these are for example in pptx custom shape presets)
    
    Change-Id: Iab21d0845d0cb6e4dadeffb5f7b9ebab1e4b955a

diff --git a/xmloff/inc/EnhancedCustomShapeToken.hxx b/xmloff/inc/EnhancedCustomShapeToken.hxx
index 39a5faf..42d95ab 100644
--- a/xmloff/inc/EnhancedCustomShapeToken.hxx
+++ b/xmloff/inc/EnhancedCustomShapeToken.hxx
@@ -84,6 +84,7 @@ namespace xmloff { namespace EnhancedCustomShapeToken {
         EAS_handle_polar,
         EAS_handle_radius_range_minimum,
         EAS_handle_radius_range_maximum,
+        EAS_sub_view_size,
 
         EAS_CustomShapeEngine,
         EAS_CustomShapeData,
@@ -145,6 +146,7 @@ namespace xmloff { namespace EnhancedCustomShapeToken {
         EAS_SameLetterHeights,
         EAS_Position,
         EAS_AdjustmentValues,
+        EAS_SubViewSize,
 
         EAS_Last,
         EAS_NotFound
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index f5b89a6..74b78f3 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -1732,6 +1732,7 @@ namespace xmloff { namespace token {
         XML_SUBTOTAL_FIELD,
         XML_SUBTOTAL_RULE,
         XML_SUBTOTAL_RULES,
+        XML_SUB_VIEW_SIZE,
         XML_SUFFIX,
         XML_SUM,
         XML_SWISS,
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 5c80146..ae4c359 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -1737,6 +1737,7 @@ namespace xmloff { namespace token {
         TOKEN( "subtotal-field",                  XML_SUBTOTAL_FIELD ),
         TOKEN( "subtotal-rule",                   XML_SUBTOTAL_RULE ),
         TOKEN( "subtotal-rules",                  XML_SUBTOTAL_RULES ),
+        TOKEN( "sub-view-size",                   XML_SUB_VIEW_SIZE ),
         TOKEN( "suffix",                          XML_SUFFIX ),
         TOKEN( "sum",                             XML_SUM ),
         TOKEN( "swiss",                           XML_SWISS ),
diff --git a/xmloff/source/draw/EnhancedCustomShapeToken.cxx b/xmloff/source/draw/EnhancedCustomShapeToken.cxx
index 1e12ee2..ba70abd 100644
--- a/xmloff/source/draw/EnhancedCustomShapeToken.cxx
+++ b/xmloff/source/draw/EnhancedCustomShapeToken.cxx
@@ -112,6 +112,7 @@ static const TokenTable pTokenTableArray[] =
     { "handle-polar",                       EAS_handle_polar },
     { "handle-radius-range-minimum",        EAS_handle_radius_range_minimum },
     { "handle-radius-range-maximum",        EAS_handle_radius_range_maximum },
+    { "sub-view-size",                      EAS_sub_view_size },
 
     { "CustomShapeEngine",                  EAS_CustomShapeEngine },
     { "CustomShapeData",                    EAS_CustomShapeData },
@@ -173,6 +174,7 @@ static const TokenTable pTokenTableArray[] =
     { "SameLetterHeights",                  EAS_SameLetterHeights },
     { "Position",                           EAS_Position },
     { "AdjustmentValues",                   EAS_AdjustmentValues },
+    { "SubViewSize",                        EAS_SubViewSize },
 
     { "Last",                               EAS_Last },
     { "NotFound",                           EAS_NotFound }
diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx
index d47b6bb..1bb5481 100644
--- a/xmloff/source/draw/shapeexport4.cxx
+++ b/xmloff/source/draw/shapeexport4.cxx
@@ -908,8 +908,26 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean
                             for ( i = 0; i < nCount; i++ )
                             {
                                 const beans::PropertyValue& rProp = aPathPropSeq[ i ];
+
                                 switch( EASGet( rProp.Name ) )
                                 {
+                                    case EAS_SubViewSize:
+                                    {
+                                        uno::Sequence< awt::Size > aSubViewSizes;
+                                        rProp.Value >>= aSubViewSizes;
+
+                                        for ( int nIdx = 0; nIdx < aSubViewSizes.getLength(); nIdx++ )
+                                        {
+                                            if ( nIdx )
+                                                aStrBuffer.append(' ');
+                                            ::sax::Converter::convertNumber( aStrBuffer, aSubViewSizes[nIdx].Width );
+                                            aStrBuffer.append(' ');
+                                            ::sax::Converter::convertNumber( aStrBuffer, aSubViewSizes[nIdx].Height );
+                                        }
+                                        aStr = aStrBuffer.makeStringAndClear();
+                                        rExport.AddAttribute( XML_NAMESPACE_DRAW_EXT, XML_SUB_VIEW_SIZE, aStr );
+                                    }
+                                    break;
                                     case EAS_ExtrusionAllowed :
                                     {
                                         sal_Bool bExtrusionAllowed = sal_Bool();
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index 3b145ca..a3406ed 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -472,6 +472,43 @@ void GetDoubleSequence( std::vector< com::sun::star::beans::PropertyValue >& rDe
     }
 }
 
+void GetSizeSequence( std::vector< com::sun::star::beans::PropertyValue >& rDest,
+                      const rtl::OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp )
+{
+    std::vector< sal_Int32 > vNum;
+    sal_Int32 nIndex = 0;
+    do
+    {
+        sal_Int32 n;
+        rtl::OUString aToken( rValue.getToken( 0, ' ', nIndex ) );
+        if (!::sax::Converter::convertNumber( n, aToken ))
+            break;
+        else
+            vNum.push_back( n );
+    }
+    while ( nIndex >= 0 );
+
+    if ( !vNum.empty() )
+    {
+        uno::Sequence< awt::Size > aSizeSeq( vNum.size() / 2 );
+        std::vector< sal_Int32 >::const_iterator aIter = vNum.begin();
+        std::vector< sal_Int32 >::const_iterator aEnd = vNum.end();
+        awt::Size* pValues = aSizeSeq.getArray();
+
+        while ( aIter != aEnd ) {
+            pValues->Width = *aIter++;
+            if ( aIter != aEnd )
+                pValues->Height = *aIter++;
+            pValues ++;
+        }
+
+        beans::PropertyValue aProp;
+        aProp.Name = EASGet( eDestProp );
+        aProp.Value <<= aSizeSeq;
+        rDest.push_back( aProp );
+    }
+}
+
 void GetEnhancedParameter( std::vector< com::sun::star::beans::PropertyValue >& rDest,              // e.g. draw:handle-position
                         const rtl::OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp )
 {
@@ -860,6 +897,9 @@ void XMLEnhancedCustomShapeContext::StartElement( const uno::Reference< xml::sax
                     mrCustomShapeGeometry.push_back( aProp );
                 }
                 break;
+                case EAS_sub_view_size:
+                    GetSizeSequence( maPath, rValue, EAS_SubViewSize );
+                break;
                 case EAS_text_rotate_angle :
                     GetDouble( mrCustomShapeGeometry, rValue, EAS_TextRotateAngle );
                 break;


More information about the Libreoffice-commits mailing list