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

use text frame part of customshapes on import

üst 7d63b777
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -37,6 +37,7 @@
#include <com/sun/star/graphic/XGraphicTransformer.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
using rtl::OUString;
using namespace ::oox::core;
......@@ -114,7 +115,7 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
aPropertyMap = maPresetsMap[ mnShapePresetType ];
#ifdef DEBUG
aPropertyMap.dump();
aPropertyMap.dumpCode();
#endif
}
else
......@@ -214,6 +215,16 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
for ( i = 0; i < maSegments.size(); i++ )
aSegments[ i ] = maSegments[ i ];
aPath[ PROP_Segments ] <<= aSegments;
if ( maTextRect.has() ) {
Sequence< EnhancedCustomShapeTextFrame > aTextFrames(1);
aTextFrames[0].TopLeft.First = maTextRect.get().l;
aTextFrames[0].TopLeft.Second = maTextRect.get().t;
aTextFrames[0].BottomRight.First = maTextRect.get().r;
aTextFrames[0].BottomRight.Second = maTextRect.get().b;
aPath[ PROP_TextFrames ] <<= aTextFrames;
}
sal_uInt32 j, k, nParameterPairs = 0;
for ( i = 0; i < maPath2DList.size(); i++ )
nParameterPairs += maPath2DList[ i ].parameter.size();
......
......@@ -48,6 +48,7 @@ using ::com::sun::star::text::WritingMode;
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
......@@ -473,9 +474,11 @@ static const char* lclDumpAnyValueCode( Any value, int level = 0)
Sequence< PropertyValue > propArray;
Sequence< Sequence< PropertyValue > > propArrayArray;
Sequence< EnhancedCustomShapeAdjustmentValue > adjArray;
Sequence< EnhancedCustomShapeTextFrame > segTextFrame;
Sequence< EnhancedCustomShapeSegment > segArray;
Sequence< EnhancedCustomShapeParameterPair > ppArray;
EnhancedCustomShapeSegment segment;
EnhancedCustomShapeTextFrame textFrame;
EnhancedCustomShapeParameterPair pp;
EnhancedCustomShapeParameter par;
awt::Rectangle rect;
......@@ -565,6 +568,19 @@ static const char* lclDumpAnyValueCode( Any value, int level = 0)
fprintf (stderr, "}\n");
}
return "aSegmentSeq";
} else if( value >>= segTextFrame ) {
printLevel (level);
fprintf (stderr, "Sequence< EnhancedCustomShapeTextFrame > aTextFrameSeq (%"SAL_PRIdINT32");\n", segTextFrame.getLength());
for( int i=0; i<segTextFrame.getLength(); i++ ) {
printLevel (level);
fprintf (stderr, "{\n");
const char *var = lclDumpAnyValueCode (makeAny (segTextFrame[i]), level + 1);
printLevel (level + 1);
fprintf (stderr, "aTextFrameSeq [%d] = %s;\n", i, var);
printLevel (level);
fprintf (stderr, "}\n");
}
return "aTextFrameSeq";
} else if( value >>= ppArray ) {
printLevel (level);
fprintf (stderr, "Sequence< EnhancedCustomShapeParameterPair > aParameterPairSeq (%"SAL_PRIdINT32");\n", ppArray.getLength());
......@@ -587,6 +603,30 @@ static const char* lclDumpAnyValueCode( Any value, int level = 0)
printLevel (level);
fprintf (stderr, "aSegment.Count = %d;\n", segment.Count);
return "aSegment";
} else if( value >>= textFrame ) {
printLevel (level);
fprintf (stderr, "EnhancedCustomShapeTextFrame aTextFrame;\n");
printLevel (level);
fprintf (stderr, "{\n");
{
const char* var = lclDumpAnyValueCode( makeAny (textFrame.TopLeft), level + 1 );
printLevel (level + 1);
fprintf (stderr, "aTextFrame.TopLeft = %s;\n", var);
}
printLevel (level);
fprintf (stderr, "}\n");
printLevel (level);
fprintf (stderr, "{\n");
{
const char* var = lclDumpAnyValueCode( makeAny (textFrame.BottomRight), level + 1 );
printLevel (level + 1);
fprintf (stderr, "aTextFrame.BottomRight = %s;\n", var);
}
printLevel (level);
fprintf (stderr, "}\n");
return "aTextFrame";
} else if( value >>= pp ) {
printLevel (level);
fprintf (stderr, "EnhancedCustomShapeParameterPair aParameterPair;\n");
......
......@@ -452,6 +452,7 @@ TextAutoGrowHeight
TextBreak
TextColor
TextFitToSize
TextFrames
TextHorizontalAdjust
TextLeftDistance
TextLowerDistance
......
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