/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include "oox/helper/propertymap.hxx"
#include "oox/helper/helper.hxx"

#if OSL_DEBUG_LEVEL > 0
# include <cstdio>
# include <com/sun/star/style/LineSpacing.hpp>
# include <com/sun/star/style/LineSpacingMode.hpp>
# include <com/sun/star/text/WritingMode.hpp>
using ::com::sun::star::style::LineSpacing;
using ::com::sun::star::text::WritingMode;
#endif

#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/container/XIndexReplace.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#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>
#include <cppuhelper/implbase2.hxx>
#include <osl/mutex.hxx>
#include "oox/token/propertynames.hxx"
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::lang::IllegalArgumentException;
using ::com::sun::star::lang::WrappedTargetException;
using ::com::sun::star::beans::Property;
using ::com::sun::star::beans::PropertyValue;
using ::com::sun::star::beans::PropertyVetoException;
using ::com::sun::star::beans::UnknownPropertyException;
using ::com::sun::star::beans::XPropertyChangeListener;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::beans::XPropertySetInfo;
using ::com::sun::star::beans::XVetoableChangeListener;
using ::com::sun::star::container::XIndexReplace;

#if OSL_DEBUG_LEVEL > 0
#include <cstdio>
#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/LineSpacingMode.hpp>
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
using namespace ::com::sun::star;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::uno;
using ::com::sun::star::style::LineSpacing;
using ::com::sun::star::text::WritingMode;
using ::com::sun::star::drawing::TextHorizontalAdjust;
using ::com::sun::star::drawing::TextVerticalAdjust;
#endif

namespace oox {
using ::com::sun::star::container::XIndexReplace;

// ============================================================================

using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::uno;
using ::com::sun::star::drawing::TextHorizontalAdjust;
using ::com::sun::star::drawing::TextVerticalAdjust;


// ============================================================================

namespace {

typedef ::cppu::WeakImplHelper2< XPropertySet, XPropertySetInfo > GenericPropertySetBase;

/** This class implements a generic XPropertySet.

    Properties of all names and types can be set and later retrieved.
    TODO: move this to comphelper or better find an existing implementation
 */
class GenericPropertySet : public GenericPropertySetBase, private ::osl::Mutex
{
public:
    explicit            GenericPropertySet( const PropertyMap& rPropMap );

    // XPropertySet
    virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (RuntimeException);
    virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException);
    virtual Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException);
    virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& xListener ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException);
    virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& aListener ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException);
    virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException);
    virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException);

    // XPropertySetInfo
    virtual Sequence< Property > SAL_CALL getProperties() throw (RuntimeException);
    virtual Property SAL_CALL getPropertyByName( const OUString& aName ) throw (UnknownPropertyException, RuntimeException);
    virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) throw (RuntimeException);

private:
    typedef ::std::map< OUString, Any > PropertyNameMap;
    PropertyNameMap     maPropMap;
};

// ----------------------------------------------------------------------------

GenericPropertySet::GenericPropertySet( const PropertyMap& rPropMap )
{
    const PropertyNameVector& rPropNames = StaticPropertyNameVector::get();
    for( PropertyMap::const_iterator aIt = rPropMap.begin(), aEnd = rPropMap.end(); aIt != aEnd; ++aIt )
        maPropMap[ rPropNames[ aIt->first ] ] = aIt->second;
}

Reference< XPropertySetInfo > SAL_CALL GenericPropertySet::getPropertySetInfo() throw (RuntimeException)
{
    return this;
}

void SAL_CALL GenericPropertySet::setPropertyValue( const OUString& rPropertyName, const Any& rValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
    ::osl::MutexGuard aGuard( *this );
    maPropMap[ rPropertyName ] = rValue;
}

Any SAL_CALL GenericPropertySet::getPropertyValue( const OUString& rPropertyName ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
    PropertyNameMap::iterator aIt = maPropMap.find( rPropertyName );
    if( aIt == maPropMap.end() )
        throw UnknownPropertyException();
    return aIt->second;
}

// listeners are not supported by this implementation
void SAL_CALL GenericPropertySet::addPropertyChangeListener( const OUString& , const Reference< XPropertyChangeListener >& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) {}
void SAL_CALL GenericPropertySet::removePropertyChangeListener( const OUString& , const Reference< XPropertyChangeListener >&  ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) {}
void SAL_CALL GenericPropertySet::addVetoableChangeListener( const OUString& , const Reference< XVetoableChangeListener >&  ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) {}
void SAL_CALL GenericPropertySet::removeVetoableChangeListener( const OUString& , const Reference< XVetoableChangeListener >&  ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) {}

// XPropertySetInfo
Sequence< Property > SAL_CALL GenericPropertySet::getProperties() throw (RuntimeException)
{
    Sequence< Property > aSeq( static_cast< sal_Int32 >( maPropMap.size() ) );
    Property* pProperty = aSeq.getArray();
    for( PropertyNameMap::iterator aIt = maPropMap.begin(), aEnd = maPropMap.end(); aIt != aEnd; ++aIt, ++pProperty )
    {
        pProperty->Name = aIt->first;
        pProperty->Handle = 0;
        pProperty->Type = aIt->second.getValueType();
        pProperty->Attributes = 0;
    }
    return aSeq;
}

Property SAL_CALL GenericPropertySet::getPropertyByName( const OUString& rPropertyName ) throw (UnknownPropertyException, RuntimeException)
{
    PropertyNameMap::iterator aIt = maPropMap.find( rPropertyName );
    if( aIt == maPropMap.end() )
        throw UnknownPropertyException();
    Property aProperty;
    aProperty.Name = aIt->first;
    aProperty.Handle = 0;
    aProperty.Type = aIt->second.getValueType();
    aProperty.Attributes = 0;
    return aProperty;
}

sal_Bool SAL_CALL GenericPropertySet::hasPropertyByName( const OUString& rPropertyName ) throw (RuntimeException)
{
    return maPropMap.find( rPropertyName ) != maPropMap.end();
}

} // namespace

// ============================================================================

PropertyMap::PropertyMap() :
    mpPropNames( &StaticPropertyNameVector::get() ) // pointer instead reference to get compiler generated copy c'tor and operator=
{
}

const OUString& PropertyMap::getPropertyName( sal_Int32 nPropId )
{
    OSL_ENSURE( (0 <= nPropId) && (nPropId < PROP_COUNT), "PropertyMap::getPropertyName - invalid property identifier" );
    return StaticPropertyNameVector::get()[ nPropId ];
}

void PropertyMap::assignAll( const PropertyMap& rPropMap )
{
    for( PropertyMap::const_iterator it=rPropMap.begin(); it != rPropMap.end(); ++it )
        (*this)[it->first] = it->second;
}

Sequence< PropertyValue > PropertyMap::makePropertyValueSequence() const
{
    Sequence< PropertyValue > aSeq( static_cast< sal_Int32 >( size() ) );
    if( !empty() )
    {
        PropertyValue* pValues = aSeq.getArray();
        for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt, ++pValues )
        {
            OSL_ENSURE( (0 <= aIt->first) && (aIt->first < PROP_COUNT), "PropertyMap::makePropertyValueSequence - invalid property identifier" );
            pValues->Name = (*mpPropNames)[ aIt->first ];
            pValues->Value = aIt->second;
            pValues->State = PropertyState_DIRECT_VALUE;
        }
    }
    return aSeq;
}

void PropertyMap::fillSequences( Sequence< OUString >& rNames, Sequence< Any >& rValues ) const
{
    rNames.realloc( static_cast< sal_Int32 >( size() ) );
    rValues.realloc( static_cast< sal_Int32 >( size() ) );
    if( !empty() )
    {
        OUString* pNames = rNames.getArray();
        Any* pValues = rValues.getArray();
        for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt, ++pNames, ++pValues )
        {
            OSL_ENSURE( (0 <= aIt->first) && (aIt->first < PROP_COUNT), "PropertyMap::fillSequences - invalid property identifier" );
            *pNames = (*mpPropNames)[ aIt->first ];
            *pValues = aIt->second;
        }
    }
}

Reference< XPropertySet > PropertyMap::makePropertySet() const
{
    return new GenericPropertySet( *this );
}

#if OSL_DEBUG_LEVEL > 0
static void lclDumpAnyValue( Any value)
{
        OUString strValue;
        Sequence< OUString > strArray;
        Sequence< Any > anyArray;
        Sequence< PropertyValue > propArray;
        Sequence< Sequence< PropertyValue > > propArrayArray;
        Sequence< EnhancedCustomShapeAdjustmentValue > adjArray;
        Sequence< EnhancedCustomShapeSegment > segArray;
        Sequence< EnhancedCustomShapeParameterPair > ppArray;
        EnhancedCustomShapeSegment segment;
        EnhancedCustomShapeParameterPair pp;
        EnhancedCustomShapeParameter par;
        HomogenMatrix3 aMatrix;
        sal_Int32 intValue = 0;
        sal_uInt32 uintValue = 0;
        sal_Int16 int16Value = 0;
        sal_uInt16 uint16Value = 0;
        float floatValue = 0;
        bool boolValue = false;
    LineSpacing spacing;
//         RectanglePoint pointValue;
    WritingMode aWritingMode;
    TextVerticalAdjust aTextVertAdj;
    TextHorizontalAdjust aTextHorizAdj;
    Reference< XIndexReplace > xNumRule;

        if( value >>= strValue )
            fprintf (stderr,"\"%s\"\n", USS( strValue ) );
        else if( value >>= strArray ) {
            fprintf (stderr,"%s\n", USS(value.getValueTypeName()));
            for( int i=0; i<strArray.getLength(); i++ )
                fprintf (stderr,"\t\t\t[%3d] \"%s\"\n", i, USS( strArray[i] ) );
        } else if( value >>= propArray ) {
            fprintf (stderr,"%s\n", USS(value.getValueTypeName()));
            for( int i=0; i<propArray.getLength(); i++ ) {
                fprintf (stderr,"\t\t\t[%3d] %s (%s) ", i, USS( propArray[i].Name ), USS(propArray[i].Value.getValueTypeName()) );
                lclDumpAnyValue( propArray[i].Value );
            }
        } else if( value >>= propArrayArray ) {
            fprintf (stderr,"%s\n", USS(value.getValueTypeName()));
            for( int i=0; i<propArrayArray.getLength(); i++ ) {
                fprintf (stderr,"\t\t\t[%3d] ", i);
                lclDumpAnyValue( makeAny (propArrayArray[i]) );
            }
        } else if( value >>= anyArray ) {
            fprintf (stderr,"%s\n", USS(value.getValueTypeName()));
            for( int i=0; i<anyArray.getLength(); i++ ) {
                fprintf (stderr,"\t\t\t[%3d] (%s) ", i, USS(value.getValueTypeName()) );
                lclDumpAnyValue( anyArray[i] );
            }
        } else if( value >>= adjArray ) {
            fprintf (stderr,"%s\n", USS(value.getValueTypeName()));
            for( int i=0; i<adjArray.getLength(); i++ ) {
                fprintf (stderr,"\t\t\t[%3d] (%s) ", i, USS(adjArray[i].Value.getValueTypeName()) );
                lclDumpAnyValue( adjArray[i].Value );
            }
        } else if( value >>= segArray ) {
            fprintf (stderr,"%s\n", USS(value.getValueTypeName()));
            for( int i=0; i<segArray.getLength(); i++ ) {
                fprintf (stderr,"\t\t\t[%3d] ", i );
                lclDumpAnyValue( makeAny( segArray[i] ) );
            }
        } else if( value >>= ppArray ) {
            fprintf (stderr,"%s\n", USS(value.getValueTypeName()));
            for( int i=0; i<ppArray.getLength(); i++ ) {
                fprintf (stderr,"\t\t\t[%3d] ", i );
                lclDumpAnyValue( makeAny( ppArray[i] ) );
            }
        } else if( value >>= segment ) {
            fprintf (stderr,"Command: %d Count: %d\n", segment.Command, segment.Count);
        } else if( value >>= pp ) {
            fprintf (stderr,"First: ");
            lclDumpAnyValue( makeAny (pp.First) );
            fprintf (stderr,"\t\t\t      Second: ");
            lclDumpAnyValue( makeAny (pp.Second) );
        } else if( value >>= par ) {
            fprintf (stderr,"Parameter (%s): ", USS(par.Value.getValueTypeName()));
            lclDumpAnyValue( par.Value );
        } else if( value >>= aMatrix ) {
            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);
        } else if( value >>= intValue )
            fprintf (stderr,"%" SAL_PRIdINT32 "            (hex: %" SAL_PRIxUINT32 ")\n", intValue, intValue);
        else if( value >>= uintValue )
            fprintf (stderr,"%" SAL_PRIuUINT32 "            (hex: %" SAL_PRIxUINT32 ")\n", uintValue, uintValue);
        else if( value >>= int16Value )
            fprintf (stderr,"%d            (hex: %x)\n", int16Value, int16Value);
        else if( value >>= uint16Value )
            fprintf (stderr,"%d            (hex: %x)\n", uint16Value, uint16Value);
        else if( value >>= floatValue )
            fprintf (stderr,"%f\n", floatValue);
        else if( value >>= boolValue )
            fprintf (stderr,"%d            (bool)\n", boolValue);
        else if( value >>= xNumRule ) {
            fprintf (stderr, "XIndexReplace\n");
            if (xNumRule.is()) {
                for (int k=0; k<xNumRule->getCount(); k++) {
                    Sequence< PropertyValue > aBulletPropSeq;
                    fprintf (stderr, "level %d\n", k);
                    if (xNumRule->getByIndex (k) >>= aBulletPropSeq) {
                        for (int j=0; j<aBulletPropSeq.getLength(); j++) {
                            fprintf(stderr, "%46s = ", USS (aBulletPropSeq[j].Name));
                            lclDumpAnyValue (aBulletPropSeq[j].Value);
                        }
                    }
                }
            } else {
                fprintf (stderr, "empty reference\n");
            }
        } else if( value >>= aWritingMode )
            fprintf (stderr, "%d writing mode\n", aWritingMode);
        else if( value >>= aTextVertAdj ) {
            const char* s = "unknown";
            switch( aTextVertAdj ) {
            case TextVerticalAdjust_TOP:
                s = "top";
                break;
            case TextVerticalAdjust_CENTER:
                s = "center";
                break;
            case TextVerticalAdjust_BOTTOM:
                s = "bottom";
                break;
            case TextVerticalAdjust_BLOCK:
                s = "block";
                break;
            case TextVerticalAdjust_MAKE_FIXED_SIZE:
                s = "make_fixed_size";
                break;
        }
        fprintf (stderr, "%s\n", s);
    } else if( value >>= aTextHorizAdj ) {
        const char* s = "unknown";
        switch( aTextHorizAdj ) {
            case TextHorizontalAdjust_LEFT:
                s = "left";
                break;
            case TextHorizontalAdjust_CENTER:
                s = "center";
                break;
            case TextHorizontalAdjust_RIGHT:
                s = "right";
                break;
            case TextHorizontalAdjust_BLOCK:
                s = "block";
                break;
            case TextHorizontalAdjust_MAKE_FIXED_SIZE:
                s = "make_fixed_size";
                break;
        }
        fprintf (stderr, "%s\n", s);
    } else if( value >>= spacing ) {
        fprintf (stderr, "mode: %d value: %d\n", spacing.Mode, spacing.Height);
    } else if( value.isExtractableTo(::getCppuType((const sal_Int32*)0))) {
        fprintf (stderr,"is extractable to int32\n");
    }
//         else if( value >>= pointValue )
//             fprintf (stderr,"%d            (RectanglePoint)\n", pointValue);
        else
      fprintf (stderr,"???           <unhandled type %s>\n", USS(value.getValueTypeName()));
}

#ifdef DBG_UTIL
void PropertyMap::dump( Reference< XPropertySet > rXPropSet )
{
    Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo ();
    Sequence< Property > props = info->getProperties ();

    OSL_TRACE("dump props, len: %d", props.getLength ());

    for (int i=0; i < props.getLength (); i++) {
        OString name = OUStringToOString( props [i].Name, RTL_TEXTENCODING_UTF8);
        fprintf (stderr,"%30s = ", name.getStr() );

        try {
            lclDumpAnyValue (rXPropSet->getPropertyValue( props [i].Name ));
        } catch (const Exception&) {
            fprintf (stderr,"unable to get '%s' value\n", USS(props [i].Name));
        }
    }
}
#endif

static void printLevel (int level)
{
    for (int i=0; i<level; i++)
        fprintf (stderr, "    ");
}

static const char *lclGetEnhancedParameterType( sal_uInt16 nType )
{
    const char* type;
    switch (nType) {
    case EnhancedCustomShapeParameterType::NORMAL:
        type = "EnhancedCustomShapeParameterType::NORMAL";
        break;
    case EnhancedCustomShapeParameterType::EQUATION:
        type = "EnhancedCustomShapeParameterType::EQUATION";
        break;
    case EnhancedCustomShapeParameterType::ADJUSTMENT:
        type = "EnhancedCustomShapeParameterType::ADJUSTMENT";
        break;
    case EnhancedCustomShapeParameterType::LEFT:
        type = "EnhancedCustomShapeParameterType::LEFT";
        break;
    case EnhancedCustomShapeParameterType::TOP:
        type = "EnhancedCustomShapeParameterType::TOP";
        break;
    case EnhancedCustomShapeParameterType::RIGHT:
        type = "EnhancedCustomShapeParameterType::RIGHT";
        break;
    case EnhancedCustomShapeParameterType::BOTTOM:
        type = "EnhancedCustomShapeParameterType::BOTTOM";
        break;
    case EnhancedCustomShapeParameterType::XSTRETCH:
        type = "EnhancedCustomShapeParameterType::XSTRETCH";
        break;
    case EnhancedCustomShapeParameterType::YSTRETCH:
        type = "EnhancedCustomShapeParameterType::YSTRETCH";
        break;
    case EnhancedCustomShapeParameterType::HASSTROKE:
        type = "EnhancedCustomShapeParameterType::HASSTROKE";
        break;
    case EnhancedCustomShapeParameterType::HASFILL:
        type = "EnhancedCustomShapeParameterType::HASFILL";
        break;
    case EnhancedCustomShapeParameterType::WIDTH:
        type = "EnhancedCustomShapeParameterType::WIDTH";
        break;
    case EnhancedCustomShapeParameterType::HEIGHT:
        type = "EnhancedCustomShapeParameterType::HEIGHT";
        break;
    case EnhancedCustomShapeParameterType::LOGWIDTH:
        type = "EnhancedCustomShapeParameterType::LOGWIDTH";
        break;
    case EnhancedCustomShapeParameterType::LOGHEIGHT:
        type = "EnhancedCustomShapeParameterType::LOGHEIGHT";
        break;
    default:
        type = "unknown";
        break;
    }
    return type;
}

static void printParameterPairData(int level, EnhancedCustomShapeParameterPair &pp)
{
    // These are always sal_Int32s so lets depend on that for our packing ...
    sal_Int32 nFirstValue, nSecondValue;
    if (!(pp.First.Value >>= nFirstValue))
        assert (false);
    if (!(pp.Second.Value >>= nSecondValue))
        assert (false);

    printLevel (level);
    fprintf (stderr, "{\n");
    printLevel (level + 1);
    fprintf (stderr, "%s,\n", lclGetEnhancedParameterType(pp.First.Type));
    printLevel (level + 1);
    fprintf (stderr, "%s,\n", lclGetEnhancedParameterType(pp.Second.Type));
    printLevel (level + 1);
    fprintf (stderr, "%d, %d\n", (int)nFirstValue, (int)nSecondValue);
    printLevel (level);
    fprintf (stderr, "}");
}

static const char* lclDumpAnyValueCode( Any value, int level = 0)
{
    OUString strValue;
    Sequence< OUString > strArray;
    Sequence< Any > anyArray;
    Sequence< awt::Size > sizeArray;
    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;
    awt::Size size;
    sal_Int32 intValue;
    sal_uInt32 uintValue;
    sal_Int16 int16Value;
    sal_uInt16 uint16Value;
    long longValue;
    float floatValue = 0;
    bool boolValue;
    LineSpacing spacing;
//         RectanglePoint pointValue;
    WritingMode aWritingMode;
    TextVerticalAdjust aTextVertAdj;
    TextHorizontalAdjust aTextHorizAdj;
    Reference< XIndexReplace > xNumRule;

    if( value >>= strValue ) {
            printLevel (level);
            fprintf (stderr,"OUString str = \"%s\";\n", USS( strValue ) );
            return "Any (str)";
    } else if( value >>= strArray ) {
            if (strArray.getLength() == 0)
                return "Sequence< OUString >(0)";

            printLevel (level);
            fprintf (stderr,"static const char *aStrings[] = {\n");
            for( int i=0; i<strArray.getLength(); i++ ) {
                printLevel (level + 1);
                fprintf (stderr,"\"%s\"%s\n", USS( strArray[i] ), i < strArray.getLength() - 1 ? "," : "" );
            }
            printLevel (level);
            fprintf (stderr,"};\n");
            return "createStringSequence( SAL_N_ELEMENTS( aStrings ), aStrings )";
        } else if( value >>= propArray ) {
            printLevel (level);
            fprintf (stderr,"Sequence< PropertyValue > aPropSequence (%" SAL_PRIdINT32 ");\n", propArray.getLength());
            for( int i=0; i<propArray.getLength(); i++ ) {
                printLevel (level);
                fprintf (stderr, "{\n");
                printLevel (level + 1);
                fprintf (stderr, "aPropSequence [%d].Name = \"%s\";\n", i, USS( propArray[i].Name ));
                const char *var = lclDumpAnyValueCode( propArray[i].Value, level + 1 );
                printLevel (level + 1);
                fprintf (stderr, "aPropSequence [%d].Value = makeAny (%s);\n", i, var);
                printLevel (level);
                fprintf (stderr, "}\n");
            }
            return "aPropSequence";
        } else if( value >>= sizeArray ) {
            printLevel (level);
            fprintf (stderr, "Sequence< awt::Size > aSizeSequence (%" SAL_PRIdINT32 ");\n", sizeArray.getLength());
            for( int i=0; i<sizeArray.getLength(); i++ ) {
                printLevel (level);
                fprintf (stderr, "{\n");
                const char *var = lclDumpAnyValueCode (makeAny (sizeArray[i]), level + 1);
                printLevel (level + 1);
                fprintf (stderr, "aSizeSequence [%d] = %s;\n", i, var);
                printLevel (level);
                fprintf (stderr, "}\n");
            }
            return "aSizeSequence";
        } else if( value >>= propArrayArray ) {
            printLevel (level);
            fprintf (stderr,"Sequence< Sequence < PropertyValue > > aPropSequenceSequence (%" SAL_PRIdINT32 ");\n", propArrayArray.getLength());
            for( int i=0; i<propArrayArray.getLength(); i++ ) {
                printLevel (level);
                fprintf (stderr, "{\n");
                const char *var = lclDumpAnyValueCode( makeAny (propArrayArray[i]), level + 1 );
                printLevel (level + 1);
                fprintf (stderr, "aPropSequenceSequence [%d] = %s;\n", i, var);
                printLevel (level);
                fprintf (stderr, "}\n");
            }
            return "aPropSequenceSequence";
        } else if( value >>= anyArray ) {
            fprintf (stderr,"%s\n", USS(value.getValueTypeName()));
            for( int i=0; i<anyArray.getLength(); i++ ) {
                fprintf (stderr,"\t\t\t[%3d] (%s) ", i, USS(value.getValueTypeName()) );
                lclDumpAnyValue( anyArray[i] );
            }
        } else if( value >>= adjArray ) {
            printLevel (level);
            fprintf (stderr,"Sequence< EnhancedCustomShapeAdjustmentValue > aAdjSequence (%" SAL_PRIdINT32 ");\n", adjArray.getLength());
            for( int i=0; i<adjArray.getLength(); i++ ) {
                printLevel (level);
                fprintf (stderr, "{\n");
                const char *var = lclDumpAnyValueCode( makeAny (adjArray[i].Value), level + 1 );
                printLevel (level + 1);
                fprintf (stderr, "aAdjSequence [%d].Value = %s;\n", i, var);
                if (adjArray[i].Name.getLength() > 0) {
                    printLevel (level + 1);
                    fprintf (stderr, "aAdjSequence [%d].Name = \"%s\";\n", i, USS (adjArray[i].Name));
                }
                printLevel (level);
                fprintf (stderr, "}\n");
            }
            return "aAdjSequence";
        } else if( value >>= segArray ) {
            if (segArray.getLength() == 0)
                return "Sequence< EnhancedCustomShapeSegment >(0)";

            printLevel (level);
            fprintf (stderr,"static const sal_uInt16 nValues[] = {\n");
            printLevel (level);
            fprintf (stderr,"// Command, Count\n");
            for( int i = 0; i < segArray.getLength(); i++ ) {
                printLevel (level + 1);
                fprintf (stderr,"%d,%d%s\n", segArray[i].Command,
                         segArray[i].Count, i < segArray.getLength() - 1 ? "," : "");
            }
            printLevel (level);
            fprintf (stderr,"};\n");
            return "createSegmentSequence( SAL_N_ELEMENTS( nValues ), nValues )";
        } 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);
            if (ppArray.getLength() == 0)
                return "Sequence< EnhancedCustomShapeParameterPair >(0)";

            fprintf (stderr, "static const CustomShapeProvider::ParameterPairData aData[] = {\n");
            for( int i = 0; i < ppArray.getLength(); i++ ) {
                printParameterPairData(level + 1, ppArray[i]);
                fprintf (stderr,"%s\n", i < ppArray.getLength() - 1 ? "," : "");
            }
            printLevel (level);
            fprintf (stderr,"};\n");

            return "createParameterPairSequence(SAL_N_ELEMENTS(aData), aData)";
        } else if( value >>= segment ) {
            printLevel (level);
            fprintf (stderr, "EnhancedCustomShapeSegment aSegment;\n");
            printLevel (level);
            // TODO: use EnhancedCustomShapeSegmentCommand constants
            fprintf (stderr, "aSegment.Command = %d;\n", segment.Command);
            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, "static const CustomShapeProvider::ParameterPairData aData =\n");
            printParameterPairData(level, pp);
            fprintf (stderr, ";\n");

            return "createParameterPair(&aData)";
        } else if( value >>= par ) {
            printLevel (level);
            fprintf (stderr,"EnhancedCustomShapeParameter aParameter;\n");
            const char* var = lclDumpAnyValueCode( par.Value, level );
            printLevel (level);
            fprintf (stderr,"aParameter.Value = %s;\n", var);
            printLevel (level);
            fprintf (stderr,"aParameter.Type = %s;\n",
                     lclGetEnhancedParameterType(par.Type));
            return "aParameter";
        } else if( value >>= longValue ) {
            printLevel (level);
            fprintf (stderr,"Any aAny ((sal_Int32) %ld);\n", longValue);
            return "aAny";
        } else if( value >>= intValue )
            fprintf (stderr,"%" SAL_PRIdINT32 "            (hex: %" SAL_PRIxUINT32 ")\n", intValue, intValue);
        else if( value >>= uintValue )
            fprintf (stderr,"%" SAL_PRIdINT32 "            (hex: %" SAL_PRIxUINT32 ")\n", uintValue, uintValue);
        else if( value >>= int16Value )
            fprintf (stderr,"%d            (hex: %x)\n", int16Value, int16Value);
        else if( value >>= uint16Value )
            fprintf (stderr,"%d            (hex: %x)\n", uint16Value, uint16Value);
        else if( value >>= floatValue )
            fprintf (stderr,"%f\n", floatValue);
        else if( value >>= boolValue ) {
            if (boolValue)
                return "Any ((sal_Bool) sal_True)";
            else
                return "Any ((sal_Bool) sal_False)";
        } else if( value >>= xNumRule ) {
            fprintf (stderr, "XIndexReplace\n");
            for (int k=0; k<xNumRule->getCount(); k++) {
                Sequence< PropertyValue > aBulletPropSeq;
                fprintf (stderr, "level %d\n", k);
                if (xNumRule->getByIndex (k) >>= aBulletPropSeq) {
                    for (int j=0; j<aBulletPropSeq.getLength(); j++) {
                        fprintf(stderr, "%46s = ", USS (aBulletPropSeq[j].Name));
                        lclDumpAnyValue (aBulletPropSeq[j].Value);
                    }
                }
            }
        } else if( value >>= aWritingMode )
            fprintf (stderr, "%d writing mode\n", aWritingMode);
        else if( value >>= aTextVertAdj ) {
            const char* s = "unknown";
            switch( aTextVertAdj ) {
            case TextVerticalAdjust_TOP:
                s = "top";
                break;
            case TextVerticalAdjust_CENTER:
                s = "center";
                break;
            case TextVerticalAdjust_BOTTOM:
                s = "bottom";
                break;
            case TextVerticalAdjust_BLOCK:
                s = "block";
                break;
            case TextVerticalAdjust_MAKE_FIXED_SIZE:
                s = "make_fixed_size";
                break;
        }
        fprintf (stderr, "%s\n", s);
    } else if( value >>= aTextHorizAdj ) {
        const char* s = "unknown";
        switch( aTextHorizAdj ) {
            case TextHorizontalAdjust_LEFT:
                s = "left";
                break;
            case TextHorizontalAdjust_CENTER:
                s = "center";
                break;
            case TextHorizontalAdjust_RIGHT:
                s = "right";
                break;
            case TextHorizontalAdjust_BLOCK:
                s = "block";
                break;
            case TextHorizontalAdjust_MAKE_FIXED_SIZE:
                s = "make_fixed_size";
                break;
        }
        fprintf (stderr, "%s\n", s);
    } else if( value >>= spacing ) {
        fprintf (stderr, "mode: %d value: %d\n", spacing.Mode, spacing.Height);
    } else if( value >>= rect ) {
            printLevel (level);
            fprintf (stderr, "awt::Rectangle aRectangle;\n");
            printLevel (level);
            fprintf (stderr, "aRectangle.X = %" SAL_PRIdINT32 ";\n", rect.X);
            printLevel (level);
            fprintf (stderr, "aRectangle.Y = %" SAL_PRIdINT32 ";\n", rect.Y);
            printLevel (level);
            fprintf (stderr, "aRectangle.Width = %" SAL_PRIdINT32 ";\n", rect.Width);
            printLevel (level);
            fprintf (stderr, "aRectangle.Height = %" SAL_PRIdINT32 ";\n", rect.Height);
            return "aRectangle";
    } else if( value >>= size ) {
            printLevel (level);
            fprintf (stderr, "awt::Size aSize;\n");
            printLevel (level);
            fprintf (stderr, "aSize.Width = %" SAL_PRIdINT32 ";\n", size.Width);
            printLevel (level);
            fprintf (stderr, "aSize.Height = %" SAL_PRIdINT32 ";\n", size.Height);
            return "aSize";
    } else if( value.isExtractableTo(::getCppuType((const sal_Int32*)0))) {
        fprintf (stderr,"is extractable to int32\n");
    }
        else
      fprintf (stderr,"???           <unhandled type %s>\n", USS(value.getValueTypeName()));

        return "";
}

void PropertyMap::dumpCode( Reference< XPropertySet > rXPropSet )
{
    Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo ();
    Sequence< Property > props = info->getProperties ();
    const OUString sType = "Type";

    for (int i=0; i < props.getLength (); i++) {

        // ignore Type, it is set elsewhere
        if (props[i].Name.equals (sType))
            continue;

        OString name = OUStringToOString( props [i].Name, RTL_TEXTENCODING_UTF8);
        int level = 1;

        try {
            printLevel (level);
            fprintf (stderr, "{\n");
            const char* var = lclDumpAnyValueCode (rXPropSet->getPropertyValue (props [i].Name), level + 1);
            printLevel (level + 1);
            fprintf (stderr,"aPropertyMap [PROP_%s] <<= %s;\n", name.getStr(), var);
            printLevel (level);
            fprintf (stderr, "}\n");
        } catch (const Exception&) {
            fprintf (stderr,"unable to get '%s' value\n", USS(props [i].Name));
        }
    }
}

void PropertyMap::dumpCode()
{
    dumpCode( Reference< XPropertySet >( makePropertySet(), UNO_QUERY ) );
}
#endif

// ============================================================================

} // namespace oox

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
n>
<option value='libreoffice-7-1-3'>libreoffice-7-1-3</option>
<option value='libreoffice-7-1-4'>libreoffice-7-1-4</option>
<option value='libreoffice-7-1-5'>libreoffice-7-1-5</option>
<option value='libreoffice-7-1-6'>libreoffice-7-1-6</option>
<option value='libreoffice-7-1-7'>libreoffice-7-1-7</option>
<option value='libreoffice-7-2'>libreoffice-7-2</option>
<option value='libreoffice-7-2-0'>libreoffice-7-2-0</option>
<option value='libreoffice-7-2-1'>libreoffice-7-2-1</option>
<option value='libreoffice-7-2-2'>libreoffice-7-2-2</option>
<option value='libreoffice-7-2-3'>libreoffice-7-2-3</option>
<option value='libreoffice-7-2-5'>libreoffice-7-2-5</option>
<option value='libreoffice-7-2-6'>libreoffice-7-2-6</option>
<option value='libreoffice-7-2-7'>libreoffice-7-2-7</option>
<option value='libreoffice-7-3'>libreoffice-7-3</option>
<option value='libreoffice-7-3-0'>libreoffice-7-3-0</option>
<option value='libreoffice-7-3-1'>libreoffice-7-3-1</option>
<option value='libreoffice-7-3-2'>libreoffice-7-3-2</option>
<option value='libreoffice-7-3-3'>libreoffice-7-3-3</option>
<option value='libreoffice-7-3-4'>libreoffice-7-3-4</option>
<option value='libreoffice-7-3-5'>libreoffice-7-3-5</option>
<option value='libreoffice-7-3-6'>libreoffice-7-3-6</option>
<option value='libreoffice-7-3-7'>libreoffice-7-3-7</option>
<option value='libreoffice-7-4'>libreoffice-7-4</option>
<option value='libreoffice-7-4-0'>libreoffice-7-4-0</option>
<option value='libreoffice-7-4-1'>libreoffice-7-4-1</option>
<option value='libreoffice-7-4-2'>libreoffice-7-4-2</option>
<option value='libreoffice-7-4-3'>libreoffice-7-4-3</option>
<option value='libreoffice-7-4-4'>libreoffice-7-4-4</option>
<option value='libreoffice-7-4-6'>libreoffice-7-4-6</option>
<option value='libreoffice-7-4-7'>libreoffice-7-4-7</option>
<option value='libreoffice-7-5'>libreoffice-7-5</option>
<option value='libreoffice-7-5-0'>libreoffice-7-5-0</option>
<option value='libreoffice-7-5-1'>libreoffice-7-5-1</option>
<option value='libreoffice-7-5-2'>libreoffice-7-5-2</option>
<option value='libreoffice-7-5-3'>libreoffice-7-5-3</option>
<option value='libreoffice-7-5-4'>libreoffice-7-5-4</option>
<option value='libreoffice-7-5-5'>libreoffice-7-5-5</option>
<option value='libreoffice-7-5-6'>libreoffice-7-5-6</option>
<option value='libreoffice-7-5-7'>libreoffice-7-5-7</option>
<option value='libreoffice-7-5-8'>libreoffice-7-5-8</option>
<option value='libreoffice-7-5-9'>libreoffice-7-5-9</option>
<option value='libreoffice-7-6'>libreoffice-7-6</option>
<option value='libreoffice-7-6-0'>libreoffice-7-6-0</option>
<option value='libreoffice-7-6-1'>libreoffice-7-6-1</option>
<option value='libreoffice-7-6-2'>libreoffice-7-6-2</option>
<option value='libreoffice-7-6-3'>libreoffice-7-6-3</option>
<option value='libreoffice-7-6-4'>libreoffice-7-6-4</option>
<option value='libreoffice-7-6-5'>libreoffice-7-6-5</option>
<option value='libreoffice-7-6-6'>libreoffice-7-6-6</option>
<option value='libreoffice-7-6-7'>libreoffice-7-6-7</option>
<option value='master' selected='selected'>master</option>
<option value='ports/macosx10.5/master'>ports/macosx10.5/master</option>
<option value='private/Ashod/cd-5.3-3.2_import_unloaded'>private/Ashod/cd-5.3-3.2_import_unloaded</option>
<option value='private/Ashod/cd-5.3-3.2_import_unloaded_share_GfxLink'>private/Ashod/cd-5.3-3.2_import_unloaded_share_GfxLink</option>
<option value='private/Ashod/cd-5.3.3.2'>private/Ashod/cd-5.3.3.2</option>
<option value='private/Ashod/cp-5.0-preinit'>private/Ashod/cp-5.0-preinit</option>
<option value='private/Ashod/fast-calc-rendering'>private/Ashod/fast-calc-rendering</option>
<option value='private/Ashod/pdfium'>private/Ashod/pdfium</option>
<option value='private/Ashod/pdfium_on_master'>private/Ashod/pdfium_on_master</option>
<option value='private/Ashod/pdfium_on_master_fixed'>private/Ashod/pdfium_on_master_fixed</option>
<option value='private/EL-SHREIF/ui_logger'>private/EL-SHREIF/ui_logger</option>
<option value='private/Minion3665/swf-export'>private/Minion3665/swf-export</option>
<option value='private/Rosemary/change-tracking'>private/Rosemary/change-tracking</option>
<option value='private/Sweetshark/killswclient'>private/Sweetshark/killswclient</option>
<option value='private/Sweetshark/lessdepend'>private/Sweetshark/lessdepend</option>
<option value='private/Sweetshark/multilistenerfix'>private/Sweetshark/multilistenerfix</option>
<option value='private/ajrhunt/c4'>private/ajrhunt/c4</option>
<option value='private/ajrhunt/cunit'>private/ajrhunt/cunit</option>
<option value='private/ajrhunt/cunitdemo'>private/ajrhunt/cunitdemo</option>
<option value='private/ajrhunt/firebird-improvement'>private/ajrhunt/firebird-improvement</option>
<option value='private/bansan/chardraw'>private/bansan/chardraw</option>
<option value='private/bubli/textboxchaining'>private/bubli/textboxchaining</option>
<option value='private/hcvcastro/preinit'>private/hcvcastro/preinit</option>
<option value='private/hcvcastro/undo-row-comment'>private/hcvcastro/undo-row-comment</option>
<option value='private/jmux/armin-strip-before-squash'>private/jmux/armin-strip-before-squash</option>
<option value='private/jmux/broken-static-win'>private/jmux/broken-static-win</option>
<option value='private/jmux/current-reorga'>private/jmux/current-reorga</option>
<option value='private/jmux/meson'>private/jmux/meson</option>
<option value='private/jmux/meson-gsoc-2021'>private/jmux/meson-gsoc-2021</option>
<option value='private/jmux/oss-fuzz'>private/jmux/oss-fuzz</option>
<option value='private/jmux/oss-fuzz-wip'>private/jmux/oss-fuzz-wip</option>
<option value='private/jmux/scheduler-fixes'>private/jmux/scheduler-fixes</option>
<option value='private/jmux/shape.odt'>private/jmux/shape.odt</option>
<option value='private/jmux/wasm-for-master'>private/jmux/wasm-for-master</option>
<option value='private/jmux/wasm-tmp'>private/jmux/wasm-tmp</option>
<option value='private/jmux/wasm_for_master_catchall'>private/jmux/wasm_for_master_catchall</option>
<option value='private/jmux/win-arm64'>private/jmux/win-arm64</option>
<option value='private/jmux/win-test-nohang'>private/jmux/win-test-nohang</option>
<option value='private/juergen/Tests'>private/juergen/Tests</option>
<option value='private/juergen/check-cjk'>private/juergen/check-cjk</option>
<option value='private/kendy/condformat-api'>private/kendy/condformat-api</option>
<option value='private/kendy/condformat-fdo82014'>private/kendy/condformat-fdo82014</option>
<option value='private/kendy/mailmerge-04'>private/kendy/mailmerge-04</option>
<option value='private/kendy/mailmerge-05'>private/kendy/mailmerge-05</option>
<option value='private/kendy/swinterpreter'>private/kendy/swinterpreter</option>
<option value='private/kendy/testcl'>private/kendy/testcl</option>
<option value='private/khaledhosny/color-fonts'>private/khaledhosny/color-fonts</option>
<option value='private/khaledhosny/vcl-cleanup-font'>private/khaledhosny/vcl-cleanup-font</option>
<option value='private/kohei/chart-bugs'>private/kohei/chart-bugs</option>
<option value='private/kohei/find-replace-all-perf'>private/kohei/find-replace-all-perf</option>
<option value='private/kohei/headless-perf'>private/kohei/headless-perf</option>
<option value='private/kohei/if-or-not-if-jump'>private/kohei/if-or-not-if-jump</option>
<option value='private/kohei/sort-ref-update'>private/kohei/sort-ref-update</option>
<option value='private/lfrb/opengl-vcl'>private/lfrb/opengl-vcl</option>
<option value='private/lgodard/calc_notes_import_export'>private/lgodard/calc_notes_import_export</option>
<option value='private/lgodard/tdf#117202'>private/lgodard/tdf#117202</option>
<option value='private/llunak/mailmerge'>private/llunak/mailmerge</option>
<option value='private/llunak/mailmerge_01'>private/llunak/mailmerge_01</option>
<option value='private/llunak/mailmerge_02'>private/llunak/mailmerge_02</option>
<option value='private/llunak/mailmerge_03'>private/llunak/mailmerge_03</option>
<option value='private/llunak/munich_12587'>private/llunak/munich_12587</option>
<option value='private/llunak/skia'>private/llunak/skia</option>
<option value='private/lmamane/basetest'>private/lmamane/basetest</option>
<option value='private/lmamane/for-julien2412'>private/lmamane/for-julien2412</option>
<option value='private/lmamane/for-julien2412-master'>private/lmamane/for-julien2412-master</option>
<option value='private/lmamane/tdf110997'>private/lmamane/tdf110997</option>
<option value='private/lmamane/timedate-controls-nanosecond'>private/lmamane/timedate-controls-nanosecond</option>
<option value='private/lmamane/validation'>private/lmamane/validation</option>
<option value='private/mcecchetti/23H1/a11y/paragraph'>private/mcecchetti/23H1/a11y/paragraph</option>
<option value='private/mcecchetti/accessibility/paragraph'>private/mcecchetti/accessibility/paragraph</option>
<option value='private/mcecchetti/amd/pdf-export-jpeg'>private/mcecchetti/amd/pdf-export-jpeg</option>
<option value='private/mcecchetti/bitmapcrc64'>private/mcecchetti/bitmapcrc64</option>
<option value='private/mcecchetti/bitmapcrc64-5-0'>private/mcecchetti/bitmapcrc64-5-0</option>
<option value='private/mcecchetti/calc-perf-unit-test'>private/mcecchetti/calc-perf-unit-test</option>
<option value='private/mcecchetti/calc-unit-test'>private/mcecchetti/calc-unit-test</option>
<option value='private/mcecchetti/gl-program-binary'>private/mcecchetti/gl-program-binary</option>
<option value='private/mert/wip_deepl'>private/mert/wip_deepl</option>
<option value='private/mikekaganski/multicolumn'>private/mikekaganski/multicolumn</option>
<option value='private/mmeeks/aafixes44'>private/mmeeks/aafixes44</option>
<option value='private/mmeeks/backports'>private/mmeeks/backports</option>
<option value='private/mmeeks/binarydatacache'>private/mmeeks/binarydatacache</option>
<option value='private/mmeeks/bitmapcrc64'>private/mmeeks/bitmapcrc64</option>
<option value='private/mmeeks/copy-paste'>private/mmeeks/copy-paste</option>
<option value='private/mmeeks/copypaste'>private/mmeeks/copypaste</option>
<option value='private/mmeeks/cp-6.2-bits'>private/mmeeks/cp-6.2-bits</option>
<option value='private/mmeeks/cp64merge'>private/mmeeks/cp64merge</option>
<option value='private/mmeeks/currency-dropdown'>private/mmeeks/currency-dropdown</option>
<option value='private/mmeeks/foo'>private/mmeeks/foo</option>
<option value='private/mmeeks/formula-iterator'>private/mmeeks/formula-iterator</option>
<option value='private/mmeeks/gldebug'>private/mmeeks/gldebug</option>
<option value='private/mmeeks/hidpi-bits'>private/mmeeks/hidpi-bits</option>
<option value='private/mmeeks/icontest'>private/mmeeks/icontest</option>
<option value='private/mmeeks/opengl-backbuffer'>private/mmeeks/opengl-backbuffer</option>
<option value='private/mmeeks/opengl-backbuffer2'>private/mmeeks/opengl-backbuffer2</option>
<option value='private/mmeeks/sandbox'>private/mmeeks/sandbox</option>
<option value='private/mmeeks/swapdatacontainer'>private/mmeeks/swapdatacontainer</option>
<option value='private/mmeeks/vcl-opengl3'>private/mmeeks/vcl-opengl3</option>
<option value='private/moggi/fix-opengl-context-problems'>private/moggi/fix-opengl-context-problems</option>
<option value='private/moggi/improved-dxf-xls-export'>private/moggi/improved-dxf-xls-export</option>
<option value='private/moggi/opengl-4-4-build-test'>private/moggi/opengl-4-4-build-test</option>
<option value='private/moggi/opengl-preparation'>private/moggi/opengl-preparation</option>
<option value='private/moggi/opengl-vcl-win'>private/moggi/opengl-vcl-win</option>
<option value='private/moggi/orcus-improvements'>private/moggi/orcus-improvements</option>
<option value='private/moggi/track-win-dc'>private/moggi/track-win-dc</option>
<option value='private/moggi/ui-test'>private/moggi/ui-test</option>
<option value='private/moggi/vcl-opengl3'>private/moggi/vcl-opengl3</option>
<option value='private/mst/sw_fieldmarkhide'>private/mst/sw_fieldmarkhide</option>
<option value='private/mst/sw_redlinehide'>private/mst/sw_redlinehide</option>
<option value='private/mst/sw_redlinehide_2'>private/mst/sw_redlinehide_2</option>
<option value='private/mst/sw_redlinehide_3'>private/mst/sw_redlinehide_3</option>
<option value='private/mst/sw_redlinehide_4a'>private/mst/sw_redlinehide_4a</option>
<option value='private/mst/sw_redlinehide_4b'>private/mst/sw_redlinehide_4b</option>
<option value='private/pranavk/modernize_gtktiledviewer'>private/pranavk/modernize_gtktiledviewer</option>
<option value='private/quwex/gsoc-box2d-experimental'>private/quwex/gsoc-box2d-experimental</option>
<option value='private/quwex/notespane-search'>private/quwex/notespane-search</option>
<option value='private/quwex/notespaneflat'>private/quwex/notespaneflat</option>
<option value='private/quwex/notespanesquashed'>private/quwex/notespanesquashed</option>
<option value='private/quwex/tdf59323'>private/quwex/tdf59323</option>
<option value='private/s.mehrbrodt/colorpicker-backport'>private/s.mehrbrodt/colorpicker-backport</option>
<option value='private/sweetshark/swdepend'>private/sweetshark/swdepend</option>
<option value='private/tbsdy/clipping'>private/tbsdy/clipping</option>
<option value='private/tbsdy/drawserverfontlayout'>private/tbsdy/drawserverfontlayout</option>
<option value='private/tbsdy/emf'>private/tbsdy/emf</option>
<option value='private/tbsdy/osl_getAllEnvironment'>private/tbsdy/osl_getAllEnvironment</option>
<option value='private/tbsdy/outdev'>private/tbsdy/outdev</option>
<option value='private/tbsdy/printinfomgr'>private/tbsdy/printinfomgr</option>
<option value='private/tbsdy/workbench'>private/tbsdy/workbench</option>
<option value='private/thb/libo-6-1+backports'>private/thb/libo-6-1+backports</option>
<option value='private/thb/libreoffice-5-2+backports'>private/thb/libreoffice-5-2+backports</option>
<option value='private/thb/sw_redlinehide-6-1'>private/thb/sw_redlinehide-6-1</option>
<option value='private/thb/tdf149754'>private/thb/tdf149754</option>
<option value='private/thb/wasm-upstreaming'>private/thb/wasm-upstreaming</option>
<option value='private/timar/cp-6.2-centos7'>private/timar/cp-6.2-centos7</option>
<option value='private/timar/fontconfigcrash'>private/timar/fontconfigcrash</option>
<option value='private/timar/pythonupgrademsp'>private/timar/pythonupgrademsp</option>
<option value='private/tml/Use-the-iOS-French-and-Italian-dictionaries-for-othe'>private/tml/Use-the-iOS-French-and-Italian-dictionaries-for-othe</option>
<option value='private/tml/android-use-bionic-linker-copy'>private/tml/android-use-bionic-linker-copy</option>
<option value='private/tml/android-use-faulty.lib'>private/tml/android-use-faulty.lib</option>
<option value='private/tml/cp-6-4-28-1'>private/tml/cp-6-4-28-1</option>
<option value='private/tml/fixwintext'>private/tml/fixwintext</option>
<option value='private/tml/iculess'>private/tml/iculess</option>
<option value='private/tml/lov-6.1.5.2'>private/tml/lov-6.1.5.2</option>
<option value='private/tml/lov-6.2.1'>private/tml/lov-6.2.1</option>
<option value='private/tml/lov-7.0.3.3'>private/tml/lov-7.0.3.3</option>
<option value='private/tml/lov-7.0.4'>private/tml/lov-7.0.4</option>
<option value='private/tml/lov-7.1.2'>private/tml/lov-7.1.2</option>
<option value='private/tml/opencl-default-1'>private/tml/opencl-default-1</option>
<option value='private/tvajngerl/staging'>private/tvajngerl/staging</option>
<option value='ref/for/distro/collabora/cp-6.2'>ref/for/distro/collabora/cp-6.2</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>LibreOffice 核心代码仓库</td><td class='sub right'>文档基金会</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit/lo/core/'>summary</a><a href='/cgit/lo/core/refs/?id=1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c'>refs</a><a class='active' href='/cgit/lo/core/log/uitest/libreoffice/calc/csv_dialog.py'>log</a><a href='/cgit/lo/core/tree/uitest/libreoffice/calc/csv_dialog.py?id=1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c'>tree</a><a href='/cgit/lo/core/commit/uitest/libreoffice/calc/csv_dialog.py?id=1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c'>commit</a><a href='/cgit/lo/core/diff/uitest/libreoffice/calc/csv_dialog.py?id=1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit/lo/core/log/uitest/libreoffice/calc/csv_dialog.py'>
<input type='hidden' name='id' value='1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit/lo/core/log/?id=1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c'>root</a>/<a href='/cgit/lo/core/log/uitest?id=1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c'>uitest</a>/<a href='/cgit/lo/core/log/uitest/libreoffice?id=1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c'>libreoffice</a>/<a href='/cgit/lo/core/log/uitest/libreoffice/calc?id=1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c'>calc</a>/<a href='/cgit/lo/core/log/uitest/libreoffice/calc/csv_dialog.py?id=1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c'>csv_dialog.py</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/cgit/lo/core/log/uitest/libreoffice/calc/csv_dialog.py?id=1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th></tr>
<tr><td><span title='2021-09-08 17:51:47 +0200'>2021-09-08</span></td><td><a href='/cgit/lo/core/commit/uitest/libreoffice/calc/csv_dialog.py?id=2c0e5d8b2e53921f09b2e5036cc25f8b0a177dd6'>uitest: sc: factor out common code</a><span class='decoration'></span></td><td>Xisco Fauli</td></tr>