22#if OSL_DEBUG_LEVEL > 0
24# include <com/sun/star/style/LineSpacing.hpp>
25# include <com/sun/star/text/WritingMode.hpp>
26using ::com::sun::star::style::LineSpacing;
27using ::com::sun::star::text::WritingMode;
32#include <com/sun/star/beans/PropertyValue.hpp>
33#include <com/sun/star/beans/XPropertySet.hpp>
34#include <com/sun/star/beans/XPropertySetInfo.hpp>
35#include <com/sun/star/container/XIndexReplace.hpp>
36#include <com/sun/star/awt/Rectangle.hpp>
37#include <com/sun/star/awt/Size.hpp>
38#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
39#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
40#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
41#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
42#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
43#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
44#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
45#include <com/sun/star/drawing/HomogenMatrix3.hpp>
47#include <osl/diagnose.h>
50#include <oox/token/properties.hxx>
52using ::com::sun::star::uno::Any;
53using ::com::sun::star::uno::Reference;
54using ::com::sun::star::uno::Sequence;
55using ::com::sun::star::beans::Property;
56using ::com::sun::star::beans::PropertyValue;
57using ::com::sun::star::beans::UnknownPropertyException;
58using ::com::sun::star::beans::XPropertyChangeListener;
59using ::com::sun::star::beans::XPropertySet;
60using ::com::sun::star::beans::XPropertySetInfo;
61using ::com::sun::star::beans::XVetoableChangeListener;
62using ::com::sun::star::container::XIndexReplace;
64#if OSL_DEBUG_LEVEL > 0
65#define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
69using ::com::sun::star::style::LineSpacing;
70using ::com::sun::star::text::WritingMode;
71using ::com::sun::star::drawing::TextHorizontalAdjust;
72using ::com::sun::star::drawing::TextVerticalAdjust;
89class GenericPropertySet :
public ::cppu::WeakImplHelper< XPropertySet, XPropertySetInfo >
92 explicit GenericPropertySet(
const PropertyMap& rPropMap );
96 virtual void SAL_CALL
setPropertyValue(
const OUString& aPropertyName,
const Any& aValue )
override;
105 virtual Property SAL_CALL getPropertyByName(
const OUString&
aName )
override;
106 virtual sal_Bool SAL_CALL hasPropertyByName(
const OUString&
Name )
override;
113GenericPropertySet::GenericPropertySet(
const PropertyMap& rPropMap )
123void SAL_CALL GenericPropertySet::setPropertyValue(
const OUString& rPropertyName,
const Any& rValue )
125 std::scoped_lock aGuard( mMutex );
126 maPropMap[ rPropertyName ] = rValue;
129Any SAL_CALL GenericPropertySet::getPropertyValue(
const OUString& rPropertyName )
131 PropertyNameMap::iterator aIt = maPropMap.find( rPropertyName );
132 if( aIt == maPropMap.end() )
133 throw UnknownPropertyException(rPropertyName);
148 for (
auto const& prop : maPropMap)
150 pProperty->Name = prop.first;
151 pProperty->Handle = 0;
152 pProperty->Type = prop.second.getValueType();
153 pProperty->Attributes = 0;
159Property SAL_CALL GenericPropertySet::getPropertyByName(
const OUString& rPropertyName )
161 PropertyNameMap::iterator aIt = maPropMap.find( rPropertyName );
162 if( aIt == maPropMap.end() )
163 throw UnknownPropertyException(rPropertyName);
165 aProperty.Name = aIt->first;
166 aProperty.Handle = 0;
167 aProperty.Type = aIt->second.getValueType();
168 aProperty.Attributes = 0;
172sal_Bool SAL_CALL GenericPropertySet::hasPropertyByName(
const OUString& rPropertyName )
174 return maPropMap.find( rPropertyName ) != maPropMap.end();
220 OSL_ENSURE( (0 <= nPropId) && (nPropId < PROP_COUNT),
"PropertyMap::getPropertyName - invalid property identifier" );
229 if(sPropName.empty())
233 for(
size_t a(0);
a < rVec.size();
a++)
234 if(rVec[
a] == sPropName)
248 Sequence< PropertyValue >
aSeq(
static_cast< sal_Int32
>(
maProperties.size() ) );
252 OSL_ENSURE( (0 <= prop.first) && (prop.first < PROP_COUNT),
"PropertyMap::makePropertyValueSequence - invalid property identifier" );
253 pValues->Name = (*mpPropNames)[ prop.first ];
255 pValues->State = PropertyState_DIRECT_VALUE;
263 rNames.realloc(
static_cast< sal_Int32
>(
maProperties.size() ) );
264 rValues.realloc(
static_cast< sal_Int32
>(
maProperties.size() ) );
268 OUString* pNames = rNames.getArray();
272 OSL_ENSURE( (0 <= prop.first) && (prop.first < PROP_COUNT),
"PropertyMap::fillSequences - invalid property identifier" );
273 *pNames = (*mpPropNames)[ prop.first ];
284 rMap.insert(std::pair<OUString, Any>((*
mpPropNames)[prop.first], prop.second));
290 return new GenericPropertySet( *
this );
293#if OSL_DEBUG_LEVEL > 0
297 Sequence< OUString > strArray;
298 Sequence< Any > anyArray;
299 Sequence< PropertyValue > propArray;
300 Sequence< Sequence< PropertyValue > > propArrayArray;
301 Sequence< EnhancedCustomShapeAdjustmentValue > adjArray;
302 Sequence< EnhancedCustomShapeSegment > segArray;
303 Sequence< EnhancedCustomShapeParameterPair > ppArray;
304 EnhancedCustomShapeSegment segment;
305 EnhancedCustomShapeParameterPair pp;
306 EnhancedCustomShapeParameter par;
307 HomogenMatrix3 aMatrix;
308 sal_Int32 intValue = 0;
309 sal_uInt32 uintValue = 0;
310 sal_Int16 int16Value = 0;
311 sal_uInt16 uint16Value = 0;
312 float floatValue = 0;
313 bool boolValue =
false;
317 TextVerticalAdjust aTextVertAdj;
318 TextHorizontalAdjust aTextHorizAdj;
319 Reference< XIndexReplace > xNumRule;
321 if(
value >>= strValue )
322 fprintf (stderr,
"\"%s\"\n",
USS( strValue ) );
323 else if(
value >>= strArray ) {
324 fprintf (stderr,
"%s\n",
USS(
value.getValueTypeName()));
325 for(
int i=0;
i<strArray.getLength();
i++ )
326 fprintf (stderr,
"\t\t\t[%3d] \"%s\"\n",
i,
USS( strArray[
i] ) );
327 }
else if(
value >>= propArray ) {
328 fprintf (stderr,
"%s\n",
USS(
value.getValueTypeName()));
329 for(
int i=0;
i<propArray.getLength();
i++ ) {
330 fprintf (stderr,
"\t\t\t[%3d] %s (%s) ",
i,
USS( propArray[
i].
Name ),
USS(propArray[
i].
Value.getValueTypeName()) );
333 }
else if(
value >>= propArrayArray ) {
334 fprintf (stderr,
"%s\n",
USS(
value.getValueTypeName()));
335 for(
int i=0;
i<propArrayArray.getLength();
i++ ) {
336 fprintf (stderr,
"\t\t\t[%3d] ",
i);
339 }
else if(
value >>= anyArray ) {
340 fprintf (stderr,
"%s\n",
USS(
value.getValueTypeName()));
341 for(
int i=0;
i<anyArray.getLength();
i++ ) {
342 fprintf (stderr,
"\t\t\t[%3d] (%s) ",
i,
USS(
value.getValueTypeName()) );
345 }
else if(
value >>= adjArray ) {
346 fprintf (stderr,
"%s\n",
USS(
value.getValueTypeName()));
347 for(
int i=0;
i<adjArray.getLength();
i++ ) {
348 fprintf (stderr,
"\t\t\t[%3d] (%s) ",
i,
USS(adjArray[
i].
Value.getValueTypeName()) );
351 }
else if(
value >>= segArray ) {
352 fprintf (stderr,
"%s\n",
USS(
value.getValueTypeName()));
353 for(
int i=0;
i<segArray.getLength();
i++ ) {
354 fprintf (stderr,
"\t\t\t[%3d] ",
i );
357 }
else if(
value >>= ppArray ) {
358 fprintf (stderr,
"%s\n",
USS(
value.getValueTypeName()));
359 for(
int i=0;
i<ppArray.getLength();
i++ ) {
360 fprintf (stderr,
"\t\t\t[%3d] ",
i );
363 }
else if(
value >>= segment ) {
364 fprintf (stderr,
"Command: %d Count: %d\n", segment.Command, segment.Count);
365 }
else if(
value >>= pp ) {
366 fprintf (stderr,
"First: ");
368 fprintf (stderr,
"\t\t\t Second: ");
370 }
else if(
value >>= par ) {
371 fprintf (stderr,
"Parameter (%s): ",
USS(par.Value.getValueTypeName()));
373 }
else if(
value >>= aMatrix ) {
374 fprintf (stderr,
"Matrix\n%f %f %f\n%f %f %f\n%f %f %f\n", aMatrix.Line1.Column1, aMatrix.Line1.Column2, aMatrix.Line1.Column3, aMatrix.Line2.Column1, aMatrix.Line2.Column2, aMatrix.Line2.Column3, aMatrix.Line3.Column1, aMatrix.Line3.Column2, aMatrix.Line3.Column3);
375 }
else if(
value >>= intValue )
376 fprintf (stderr,
"%-10" SAL_PRIdINT32
" (hex: %" SAL_PRIxUINT32
")\n", intValue, intValue);
377 else if(
value >>= uintValue )
378 fprintf (stderr,
"%-10" SAL_PRIuUINT32
" (hex: %" SAL_PRIxUINT32
")\n", uintValue, uintValue);
379 else if(
value >>= int16Value )
380 fprintf (stderr,
"%-10d (hex: %x)\n", int16Value, int16Value);
381 else if(
value >>= uint16Value )
382 fprintf (stderr,
"%-10d (hex: %x)\n", uint16Value, uint16Value);
383 else if(
value >>= floatValue )
384 fprintf (stderr,
"%f\n", floatValue);
385 else if(
value >>= boolValue )
386 fprintf (stderr,
"%-10d (bool)\n", boolValue);
387 else if(
value >>= xNumRule ) {
388 fprintf (stderr,
"XIndexReplace\n");
390 for (
int k=0; k<xNumRule->getCount(); k++) {
391 Sequence< PropertyValue > aBulletPropSeq;
392 fprintf (stderr,
"level %d\n", k);
393 if (xNumRule->getByIndex (k) >>= aBulletPropSeq) {
394 for (
const PropertyValue& rProp : std::as_const(aBulletPropSeq)) {
395 fprintf(stderr,
"%46s = ",
USS (rProp.Name));
401 fprintf (stderr,
"empty reference\n");
403 }
else if(
value >>= aWritingMode )
404 fprintf(stderr,
"%d writing mode\n",
static_cast<int>(aWritingMode));
405 else if(
value >>= aTextVertAdj ) {
406 const char* s =
"unknown";
407 switch( aTextVertAdj ) {
408 case TextVerticalAdjust_TOP:
411 case TextVerticalAdjust_CENTER:
414 case TextVerticalAdjust_BOTTOM:
417 case TextVerticalAdjust_BLOCK:
420 case TextVerticalAdjust::TextVerticalAdjust_MAKE_FIXED_SIZE:
421 s =
"make_fixed_size";
424 fprintf (stderr,
"%s\n", s);
425 }
else if(
value >>= aTextHorizAdj ) {
426 const char* s =
"unknown";
427 switch( aTextHorizAdj ) {
428 case TextHorizontalAdjust_LEFT:
431 case TextHorizontalAdjust_CENTER:
434 case TextHorizontalAdjust_RIGHT:
437 case TextHorizontalAdjust_BLOCK:
440 case TextHorizontalAdjust::TextHorizontalAdjust_MAKE_FIXED_SIZE:
441 s =
"make_fixed_size";
444 fprintf (stderr,
"%s\n", s);
445 }
else if(
value >>= spacing ) {
446 fprintf (stderr,
"mode: %d value: %d\n", spacing.Mode, spacing.Height);
448 fprintf (stderr,
"is extractable to int32\n");
453 fprintf (stderr,
"??? <unhandled type %s>\n",
USS(
value.getValueTypeName()));
459 Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo ();
460 const Sequence< Property >
props = info->getProperties ();
466 fprintf (stderr,
"%30s = ",
name.getStr() );
471 fprintf (stderr,
"unable to get '%s' value\n",
USS(prop.Name));
479 for (
int i=0;
i<level;
i++)
480 fprintf (stderr,
" ");
487 case EnhancedCustomShapeParameterType::NORMAL:
488 type =
"EnhancedCustomShapeParameterType::NORMAL";
490 case EnhancedCustomShapeParameterType::EQUATION:
491 type =
"EnhancedCustomShapeParameterType::EQUATION";
493 case EnhancedCustomShapeParameterType::ADJUSTMENT:
494 type =
"EnhancedCustomShapeParameterType::ADJUSTMENT";
496 case EnhancedCustomShapeParameterType::LEFT:
497 type =
"EnhancedCustomShapeParameterType::LEFT";
499 case EnhancedCustomShapeParameterType::TOP:
500 type =
"EnhancedCustomShapeParameterType::TOP";
502 case EnhancedCustomShapeParameterType::RIGHT:
503 type =
"EnhancedCustomShapeParameterType::RIGHT";
505 case EnhancedCustomShapeParameterType::BOTTOM:
506 type =
"EnhancedCustomShapeParameterType::BOTTOM";
508 case EnhancedCustomShapeParameterType::XSTRETCH:
509 type =
"EnhancedCustomShapeParameterType::XSTRETCH";
511 case EnhancedCustomShapeParameterType::YSTRETCH:
512 type =
"EnhancedCustomShapeParameterType::YSTRETCH";
514 case EnhancedCustomShapeParameterType::HASSTROKE:
515 type =
"EnhancedCustomShapeParameterType::HASSTROKE";
517 case EnhancedCustomShapeParameterType::HASFILL:
518 type =
"EnhancedCustomShapeParameterType::HASFILL";
520 case EnhancedCustomShapeParameterType::WIDTH:
521 type =
"EnhancedCustomShapeParameterType::WIDTH";
523 case EnhancedCustomShapeParameterType::HEIGHT:
524 type =
"EnhancedCustomShapeParameterType::HEIGHT";
526 case EnhancedCustomShapeParameterType::LOGWIDTH:
527 type =
"EnhancedCustomShapeParameterType::LOGWIDTH";
529 case EnhancedCustomShapeParameterType::LOGHEIGHT:
530 type =
"EnhancedCustomShapeParameterType::LOGHEIGHT";
542 sal_Int32 nFirstValue = {};
543 sal_Int32 nSecondValue = {};
544 if (!(pp.First.Value >>= nFirstValue))
546 if (!(pp.Second.Value >>= nSecondValue))
550 fprintf (stderr,
"{\n");
556 fprintf (stderr,
"%d, %d\n",
static_cast<int>(nFirstValue),
static_cast<int>(nSecondValue));
558 fprintf (stderr,
"}");
564 Sequence< OUString > strArray;
565 Sequence< Any > anyArray;
566 Sequence< awt::Size > sizeArray;
567 Sequence< PropertyValue > propArray;
568 Sequence< Sequence< PropertyValue > > propArrayArray;
569 Sequence< EnhancedCustomShapeAdjustmentValue > adjArray;
570 Sequence< EnhancedCustomShapeTextFrame > segTextFrame;
571 Sequence< EnhancedCustomShapeSegment > segArray;
572 Sequence< EnhancedCustomShapeParameterPair > ppArray;
573 EnhancedCustomShapeSegment segment;
574 EnhancedCustomShapeTextFrame textFrame;
575 EnhancedCustomShapeParameterPair pp;
576 EnhancedCustomShapeParameter par;
580 sal_uInt32 uintValue;
581 sal_Int16 int16Value;
582 sal_uInt16 uint16Value;
583 sal_Int64 int64Value;
584 float floatValue = 0;
589 TextVerticalAdjust aTextVertAdj;
590 TextHorizontalAdjust aTextHorizAdj;
591 Reference< XIndexReplace > xNumRule;
593 if(
value >>= strValue )
596 fprintf (stderr,
"OUString str = \"%s\";\n",
USS( strValue ) );
599 else if(
value >>= strArray )
601 if (strArray.getLength() == 0)
602 return "Sequence< OUString >(0)";
605 fprintf (stderr,
"static const char *aStrings[] = {\n");
606 for(
int i=0;
i<strArray.getLength();
i++ ) {
608 fprintf (stderr,
"\"%s\"%s\n",
USS( strArray[
i] ),
i < strArray.getLength() - 1 ?
"," :
"" );
611 fprintf (stderr,
"};\n");
612 return "createStringSequence( SAL_N_ELEMENTS( aStrings ), aStrings )";
614 else if(
value >>= propArray )
617 fprintf (stderr,
"Sequence< PropertyValue > aPropSequence (%" SAL_PRIdINT32
");\n", propArray.getLength());
618 for(
int i=0;
i<propArray.getLength();
i++ ) {
620 fprintf (stderr,
"{\n");
622 fprintf (stderr,
"aPropSequence [%d].Name = \"%s\";\n",
i,
USS( propArray[
i].
Name ));
625 fprintf (stderr,
"aPropSequence [%d].Value = makeAny (%s);\n",
i, var);
627 fprintf (stderr,
"}\n");
629 return "aPropSequence";
631 else if(
value >>= sizeArray )
634 fprintf (stderr,
"Sequence< awt::Size > aSizeSequence (%" SAL_PRIdINT32
");\n", sizeArray.getLength());
635 for(
int i=0;
i<sizeArray.getLength();
i++ ) {
637 fprintf (stderr,
"{\n");
640 fprintf (stderr,
"aSizeSequence [%d] = %s;\n",
i, var);
642 fprintf (stderr,
"}\n");
644 return "aSizeSequence";
646 else if(
value >>= propArrayArray )
649 fprintf (stderr,
"Sequence< Sequence < PropertyValue > > aPropSequenceSequence (%" SAL_PRIdINT32
");\n", propArrayArray.getLength());
650 for(
int i=0;
i<propArrayArray.getLength();
i++ ) {
652 fprintf (stderr,
"{\n");
655 fprintf (stderr,
"aPropSequenceSequence [%d] = %s;\n",
i, var);
657 fprintf (stderr,
"}\n");
659 return "aPropSequenceSequence";
661 else if(
value >>= anyArray )
663 fprintf (stderr,
"%s\n",
USS(
value.getValueTypeName()));
664 for(
int i=0;
i<anyArray.getLength();
i++ ) {
665 fprintf (stderr,
"\t\t\t[%3d] (%s) ",
i,
USS(
value.getValueTypeName()) );
669 else if(
value >>= adjArray )
672 fprintf (stderr,
"Sequence< EnhancedCustomShapeAdjustmentValue > aAdjSequence (%" SAL_PRIdINT32
");\n", adjArray.getLength());
673 for(
int i=0;
i<adjArray.getLength();
i++ ) {
675 fprintf (stderr,
"{\n");
678 fprintf (stderr,
"aAdjSequence [%d].Value = %s;\n",
i, var);
679 if (adjArray[
i].
Name.getLength() > 0) {
681 fprintf (stderr,
"aAdjSequence [%d].Name = \"%s\";\n",
i,
USS (adjArray[
i].
Name));
684 fprintf (stderr,
"}\n");
686 return "aAdjSequence";
688 else if(
value >>= segArray )
690 if (segArray.getLength() == 0)
691 return "Sequence< EnhancedCustomShapeSegment >(0)";
694 fprintf (stderr,
"static const sal_uInt16 nValues[] = {\n");
696 fprintf (stderr,
"// Command, Count\n");
697 for(
int i = 0;
i < segArray.getLength();
i++ ) {
699 fprintf (stderr,
"%d,%d%s\n", segArray[
i].
Command,
700 segArray[
i].
Count,
i < segArray.getLength() - 1 ?
"," :
"");
703 fprintf (stderr,
"};\n");
704 return "createSegmentSequence( SAL_N_ELEMENTS( nValues ), nValues )";
706 else if(
value >>= segTextFrame )
709 fprintf (stderr,
"Sequence< EnhancedCustomShapeTextFrame > aTextFrameSeq (%" SAL_PRIdINT32
");\n", segTextFrame.getLength());
710 for(
int i=0;
i<segTextFrame.getLength();
i++ ) {
712 fprintf (stderr,
"{\n");
715 fprintf (stderr,
"aTextFrameSeq [%d] = %s;\n",
i, var);
717 fprintf (stderr,
"}\n");
719 return "aTextFrameSeq";
721 else if(
value >>= ppArray )
724 if (ppArray.getLength() == 0)
725 return "Sequence< EnhancedCustomShapeParameterPair >(0)";
727 fprintf (stderr,
"static const CustomShapeProvider::ParameterPairData aData[] = {\n");
728 for(
int i = 0;
i < ppArray.getLength();
i++ ) {
730 fprintf (stderr,
"%s\n",
i < ppArray.getLength() - 1 ?
"," :
"");
733 fprintf (stderr,
"};\n");
735 return "createParameterPairSequence(SAL_N_ELEMENTS(aData), aData)";
737 else if(
value >>= segment )
740 fprintf (stderr,
"EnhancedCustomShapeSegment aSegment;\n");
743 fprintf (stderr,
"aSegment.Command = %d;\n", segment.Command);
745 fprintf (stderr,
"aSegment.Count = %d;\n", segment.Count);
748 else if(
value >>= textFrame )
751 fprintf (stderr,
"EnhancedCustomShapeTextFrame aTextFrame;\n");
753 fprintf (stderr,
"{\n");
757 fprintf (stderr,
"aTextFrame.TopLeft = %s;\n", var);
760 fprintf (stderr,
"}\n");
763 fprintf (stderr,
"{\n");
767 fprintf (stderr,
"aTextFrame.BottomRight = %s;\n", var);
770 fprintf (stderr,
"}\n");
774 else if(
value >>= pp )
777 fprintf (stderr,
"static const CustomShapeProvider::ParameterPairData aData =\n");
779 fprintf (stderr,
";\n");
781 return "createParameterPair(&aData)";
783 else if(
value >>= par )
786 fprintf (stderr,
"EnhancedCustomShapeParameter aParameter;\n");
789 fprintf (stderr,
"aParameter.Value = %s;\n", var);
791 fprintf (stderr,
"aParameter.Type = %s;\n",
795 else if(
value >>= int64Value )
798 fprintf (stderr,
"Any aAny ((sal_Int64) %" SAL_PRIdINT64
");\n", int64Value);
801 else if(
value >>= intValue )
802 fprintf (stderr,
"%" SAL_PRIdINT32
" (hex: %" SAL_PRIxUINT32
")\n", intValue, intValue);
803 else if(
value >>= uintValue )
804 fprintf (stderr,
"%" SAL_PRIdINT32
" (hex: %" SAL_PRIxUINT32
")\n", uintValue, uintValue);
805 else if(
value >>= int16Value )
806 fprintf (stderr,
"%d (hex: %x)\n", int16Value, int16Value);
807 else if(
value >>= uint16Value )
808 fprintf (stderr,
"%d (hex: %x)\n", uint16Value, uint16Value);
809 else if(
value >>= floatValue )
810 fprintf (stderr,
"%f\n", floatValue);
811 else if(
value >>= boolValue ) {
813 return "(sal_Bool) sal_True";
815 return "(sal_Bool) sal_False";
817 else if(
value >>= xNumRule ) {
818 fprintf (stderr,
"XIndexReplace\n");
819 for (
int k=0; k<xNumRule->getCount(); k++) {
820 Sequence< PropertyValue > aBulletPropSeq;
821 fprintf (stderr,
"level %d\n", k);
822 if (xNumRule->getByIndex (k) >>= aBulletPropSeq) {
823 for (
const PropertyValue& rProp : std::as_const(aBulletPropSeq)) {
824 fprintf(stderr,
"%46s = ",
USS (rProp.Name));
830 else if(
value >>= aWritingMode )
831 fprintf (stderr,
"%d writing mode\n",
static_cast<int>(aWritingMode));
832 else if(
value >>= aTextVertAdj ) {
833 const char* s =
"unknown";
834 switch( aTextVertAdj ) {
835 case TextVerticalAdjust_TOP:
838 case TextVerticalAdjust_CENTER:
841 case TextVerticalAdjust_BOTTOM:
844 case TextVerticalAdjust_BLOCK:
847 case TextVerticalAdjust::TextVerticalAdjust_MAKE_FIXED_SIZE:
848 s =
"make_fixed_size";
851 fprintf (stderr,
"%s\n", s);
853 else if(
value >>= aTextHorizAdj ) {
854 const char* s =
"unknown";
855 switch( aTextHorizAdj ) {
856 case TextHorizontalAdjust_LEFT:
859 case TextHorizontalAdjust_CENTER:
862 case TextHorizontalAdjust_RIGHT:
865 case TextHorizontalAdjust_BLOCK:
868 case TextHorizontalAdjust::TextHorizontalAdjust_MAKE_FIXED_SIZE:
869 s =
"make_fixed_size";
872 fprintf (stderr,
"%s\n", s);
874 else if(
value >>= spacing ) {
875 fprintf (stderr,
"mode: %d value: %d\n", spacing.Mode, spacing.Height);
877 else if(
value >>= rect ) {
879 fprintf (stderr,
"awt::Rectangle aRectangle;\n");
881 fprintf (stderr,
"aRectangle.X = %" SAL_PRIdINT32
";\n", rect.X);
883 fprintf (stderr,
"aRectangle.Y = %" SAL_PRIdINT32
";\n", rect.Y);
885 fprintf (stderr,
"aRectangle.Width = %" SAL_PRIdINT32
";\n", rect.Width);
887 fprintf (stderr,
"aRectangle.Height = %" SAL_PRIdINT32
";\n", rect.Height);
892 fprintf (stderr,
"awt::Size aSize;\n");
894 fprintf (stderr,
"aSize.Width = %" SAL_PRIdINT32
";\n",
size.Width);
896 fprintf (stderr,
"aSize.Height = %" SAL_PRIdINT32
";\n",
size.Height);
900 fprintf (stderr,
"is extractable to int32\n");
903 fprintf (stderr,
"??? <unhandled type %s>\n",
USS(
value.getValueTypeName()));
910 Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo ();
911 const Sequence< Property >
props = info->getProperties ();
912 static constexpr OUStringLiteral
sType =
u"Type";
917 if (rProp.Name ==
sType)
925 fprintf (stderr,
"{\n");
926 const char* var =
lclDumpAnyValueCode (rXPropSet->getPropertyValue (rProp.Name), level + 1);
928 fprintf (stderr,
"aPropertyMap.setProperty(PROP_%s, %s);\n",
name.getStr(), var);
930 fprintf (stderr,
"}\n");
932 fprintf (stderr,
"unable to get '%s' value\n",
USS(rProp.Name));
939 Reference<XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
940 const Sequence<Property>
aProperties = xPropertySetInfo->getProperties();
944 std::cerr << rProp.Name << std::endl;
const PropertyValue * pValues
PropertiesInfo aProperties
A helper that maps property identifiers to property values.
const std::vector< OUString > * mpPropNames
bool setAnyProperty(sal_Int32 nPropId, const css::uno::Any &rValue)
Sets the specified property to the passed value.
void assignUsed(const PropertyMap &rPropMap)
Inserts all properties contained in the passed property map.
void erase(sal_Int32 nPropId)
std::map< sal_Int32, css::uno::Any > maProperties
void fillSequences(css::uno::Sequence< OUString > &rNames, css::uno::Sequence< css::uno::Any > &rValues) const
Fills the passed sequences of names and anys with all contained properties.
static void dumpData(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet)
css::uno::Any getProperty(sal_Int32 nPropId)
bool hasProperty(sal_Int32 nPropId) const
Returns true, if the map contains a property with the passed identifier.
void assignAll(const PropertyMap &rPropMap)
Inserts all properties contained in the passed property map.
static const OUString & getPropertyName(sal_Int32 nPropId)
Returns the name of the passed property identifier.
static void dump(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet)
static sal_Int32 getPropertyId(std::u16string_view sPropName)
Returns the property identifier of the passed name.
css::uno::Sequence< css::beans::PropertyValue > makePropertyValueSequence() const
Returns a sequence of property values, filled with all contained properties.
void fillPropertyNameMap(PropertyNameMap &rMap) const
static void dumpCode(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet)
css::uno::Reference< css::beans::XPropertySet > makePropertySet() const
Creates a property set supporting the XPropertySet interface and inserts all properties.
Sequence< sal_Int8 > aSeq
#define SAL_INFO(area, stream)
OUString anyToString(uno::Any const &value)
VBAHELPER_DLLPUBLIC bool setPropertyValue(css::uno::Sequence< css::beans::PropertyValue > &aProp, const OUString &aName, const css::uno::Any &aValue)
static void printLevel(int level)
static const char * lclGetEnhancedParameterType(sal_uInt16 nType)
static void lclDumpAnyValue(const Any &value)
const std::vector< OUString > & GetPropertyNameVector()
A vector that contains all predefined property names used in the filters.
static void printParameterPairData(int level, EnhancedCustomShapeParameterPair const &pp)
static const char * lclDumpAnyValueCode(const Any &value, int level)
::std::map< OUString, css::uno::Any > PropertyNameMap
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)