Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/security/nss/cmd/crmftest/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 588 B image not shown  

Quellcode-Bibliothek vbastyles.cxx   Sprache: C

 

/* -*- 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 *
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 *
* java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 68
 *  with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
" ASF  
 *   except in compliance with the *   License, Version 2.0 (the "License")mayusejava.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 68
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .

#include "vbastyles.hxx"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#includeinclude java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
#include </.hxx>
#nclude <sal/log.hxx>
#include <com/un/star/container/XEnumerationAccess.hpp>
# <om//star/langIndexOutOfBoundsException.>
# </sun// *   the License at http://www.apache.org/licenses-20.
#include <om//starstyle/java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 29
# oovbaword/dBuiltinStyle>
# <oovba/WdStyleType.hpp>
iowordhpp
#.hxxjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23

  ::vba;
namespace :::un:tarjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

namespace {

struct BuiltinStyleTable
{
    wdBuiltinStyle
     char* ;
     sal_Int32 wdStyleType;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 2

}

onst    { word::WdBuiltinSt: " word:::java.lang.StringIndexOutOfBoundsException: Range [89, 88) out of bounds for length 91
java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 1
    { word::    word:WdBuiltinStyle:,",word     :WdBuiltinStyle:wdStyleEnvelopeAddress ,:java.lang.StringIndexOutOfBoundsException: Range [96, 95) out of bounds for length 98
{ph}
    { word::WdBuiltinStyle:: {word:WdBuiltinStyle:wdStyleClosing, " :::dStyleTypeParagraph java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
, {::java.lang.StringIndexOutOfBoundsException: Range [54, 51) out of bounds for length 99
: indent,:W:dStyleTypeParagraph ,
{wordWdBuiltinStylew " :: ,
:{word:WdBuiltinStyle:" :java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 94
     :wdStyleBodyTextIndent2 ",:dStyleType:w },
    { word::dStyleBodyTextIndent3 " word:{word:WdBuiltinStyle:wdStyleHeader, "Header", word::WdStyleType::    { word::WdBuiltinStyle::wdStyleHeading1, "Heading 1", word::WdStyleType: },
WdStyleType     word:dBuiltinStyle,",word:dStyleType:}
    {WdBuiltinStyle:wdStyleHeading9,"eading 9", word::WdStyleTypew{ word::WdBuiltinStyle::wdStyleIndex1, "Index 1", word::WdStyleType::wdStyleTypeParagraph
    {word::dStyleCommentReference,"" word::WdStyleType::wdStyleTypeParagraph },
    { word::{ word::WdBuiltinStyle:, {word:WdBuiltinStyle:wdStyleHtmlCode, " word::wdStyleTypeParagraph },
 word::wdStyleHtmlPre, "", word::WdStyleType::wdStyleTypeParagraph },
dStyleType:java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 90
     :java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 91
    { word::WdBuiltinStyle{word:dBuiltinStyle:wdStyleList3 "ist     ::wdStyleHyperlink,", :: ,
    { word      word:W:w,",word::}
    {word:WdBuiltinStyle::wdStyleEnvelopeAddress, "",     {word:WdBuiltinStyle:wdStyleListContinue,",word:dStyleType:dStyleTypeParagraph },
 ::w " ::WdStyleType:w}
    :WdBuiltinStyle:{word:dBuiltinStyle::wdStyleList2, "List 2", word::WdStyleType::wdStyleTypeParagraph },
    word::    { word::WdBuiltinStyle::wdStyleListBullet2word::java.lang.StringIndexOutOfBoundsException: Range [75, 46) out of bounds for length 95
    {word{:WdBuiltinStyle:wdStyleListBullet4,List4" :: }java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
    { word:WdBuiltinStyle{wdStyleListContinue," WdStyleType:}
   java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 93
    { word::WdBuiltinStyle word:WdBuiltinStyle:w     word::WdBuiltinStyle::wdStyleListContinue5, "", word::WdStyleType::{word:WdBuiltinStyle::wdStyleStrong    {word:WdBuiltinStyle:wdStyleListNumber," ",::dStyleType:     word:WdBuiltinStyle::wdStyleSubtitle, "", word::WdStyleType::wdStyleTypeParagraph },
    {container::IndexAccessjava.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
    {word::dBuiltinStyle::wdStyleHeading4, "Heading 4", word::WdStyleType::java.lang.StringIndexOutOfBoundsException: Range [0, 97) out of bounds for length 1
    {word:WdBuiltinStyle::wdStyleHeading5, "Heading 5", word::WdStyleType::wdStyleTypeParagraph },
d     uno:ypeSAL_CALLgetElementType(      :java.lang.StringIndexOutOfBoundsException: Index 107 out of bounds for length 107
    {java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
::wdStyleHeading8 H8, :WdStyleType: ,
    {word:WdBuiltinStyle::wdStyleHeading9,"eading 9, word:::}java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
    :
    { word:            (   :Reference  &_Model java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
    { word::WdBuiltinStyle::    virtual uno::Type SAL_CALL getElementType }
        if( mxParaStyles->hasByName( aName ) )
    {              container            
    Sequence<OUString >SAL_CALLgetElementNames()
     :::,",word:dStyleType:dStyleTypeParagraph}
{ word:WdBuiltinStyle:wdStyleHtmlPre,"    if StyleName! end)
    { word::    // XIndexAccesspTable=;pTable-MSOStyleName= pTable+java.lang.StringIndexOutOfBoundsException: Index 111 out of bounds for length 111
    { word::WdBuiltinStyle:                
     ::," ::java.lang.StringIndexOutOfBoundsException: Range [89, 87) out of bounds for length 90
    {
     :java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 93
    { word::WdBuiltinStyle::wdStyleIndex1, "Index 1", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleIndex2
: "dex 3"word:dStyleType: },
     njava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 53
    { word::java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
 : " :java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 89
     :     :  :java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 70
     :dBuiltinStyle:w,",:dStyleTypejava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 5
    { word::WdBuiltinStyle::wdStyleIndex9, "", word:     SwVbaStyles_BASE  , 
{:W:wdStyleIndexHeading," ",:WdStyleType:java.lang.StringIndexOutOfBoundsException: Index 103 out of bounds for length 1
    { word::WdBuiltinStyle::java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 5
    { word::   pStylesgjava.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 48
    { java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    ;
    { word}
     word::dBuiltinStyle::dStyleList5""::}
rd:dStyleType:wdStyleTypeList }
    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    { word::WdBuiltinStyle::wdStyleListBullet3,                OUString java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
     word:W::wdStyleListBullet4, "List 4", word::WdStyleType::wdStyleTypeList }
    { word:{
    { word::java.lang.StringIndexOutOfBoundsException: Range [24, 15) out of bounds for length 64
    { word::WdBuiltinStylejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    { word::wVbaStyles::createEnumeration()
         new (this )java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    { word::WdBuiltinStylertl:eferenceSwXStyleFamily > >-GetStylesByName(aStyleType  ;
 123" :dStyleType::dStyleTypeList}java.lang.StringIndexOutOfBoundsException: Index 101 out of bounds for length 101
    {word:WdBuiltinStyle:,Numbering " ord:dStyleType:wdStyleTypeListjava.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 102
(java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 6
    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    {/*
    { word::WdBuiltinStyle::wdStyleMacroText,                     
    { word::WdBuiltinStyle::wdStyleMessageHeader, "", word::WdStyleType aStyleType=;
    { word::               
    { word::WdBuiltinStyle::wdStyleNormal, "Default", wordaStyleType ParagraphStyles"java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    { word::WdBuiltinStyle::wdStyleNormalIndent, "", word::WdStyleType::wdStyleTypeParagraph },
:,T",:java.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 99
iltinStyle:, " :WdStyleType:wdStyleTypeParagraph ,
     :::, ",word:WdStyleType:: }java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
    {        }
    { word::WdBuiltinStyle::wdStyleSalutation, "", word:    return SwVbaStyles_BASE::Item( Index1, Index2 );
    { word::WdBuiltinStyle     :Sequence< OUString  const aServiceNames
    { word::WdBuiltinStyle::wdStyleStrong, "", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleSubtitle, "", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTableOfAuthorities, "", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTableOfFigures, "", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTitle, "Title", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTOAHeading, "Contents Heading", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTOC1, "Contents 1", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTOC2, "Contents 2", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTOC3, "Contents 3", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTOC4, "Contents 4", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTOC5, "Contents 5", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTOC6, "Contents 6", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTOC7, "Contents 7", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTOC8, "Contents 8", word::WdStyleType::wdStyleTypeParagraph },
    { word::WdBuiltinStyle::wdStyleTOC9, "Contents 9", word::WdStyleType::wdStyleTypeParagraph },
    { 0, nullptr, 0 }
};

namespace {

struct MSOStyleNameTable
{
    const char* pMSOStyleName;
    const char* pOOoStyleName;
};

}

const MSOStyleNameTable aMSOStyleNameTable[] =
{
    { "Normal", "Default" },
    { nullptr, nullptr }
};

namespace {

class StyleCollectionHelper : public ::cppu::WeakImplHelper< container::XNameAccess,
                                                             container::XIndexAccess,
                                                             container::XEnumerationAccess >
{
private:
    rtl::Reference< SwXStyleFamily > mxParaStyles;
    uno::Any m_cachePos;
public:
    explicit StyleCollectionHelper( const rtl::Reference< SwXTextDocument >& _xModel )
    {
        // we only concern about the Paragraph styles
        rtl::Reference< SwXStyleFamilies > xStyleFamilies = _xModel->getSwStyleFamilies();
        mxParaStyles = xStyleFamilies->GetParagraphStyles();
    }
    // XElementAccess
    virtual uno::Type SAL_CALL getElementType(  ) override { return  cppu::UnoType<style::XStyle>::get(); }
    virtual sal_Bool SAL_CALL hasElements(  ) override { return getCount() > 0; }
    // XNameAccess
    virtual uno::Any SAL_CALL getByName( const OUString& aName ) override
    {
        if ( !hasByName(aName) )
            throw container::NoSuchElementException();
        return m_cachePos;
    }
    virtual uno::Sequence< OUString > SAL_CALL getElementNames(  ) override
    {
        return mxParaStyles->getElementNames();
    }
    virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override
    {
        // search in the MSOStyleName table first
        for( const MSOStyleNameTable* pTable = aMSOStyleNameTable; pTable->pMSOStyleName != nullptr; pTable++ )
        {
            if( aName.equalsIgnoreAsciiCaseAscii( pTable->pMSOStyleName ) )
            {
                //Found it
                OUString sStyleName = OUString::createFromAscii( pTable->pOOoStyleName );
                if( mxParaStyles->hasByName( sStyleName ) )
                {
                    m_cachePos = mxParaStyles->getByName( sStyleName );
                    return true;
                }
                return false;
            }
        }

        if( mxParaStyles->hasByName( aName ) )
        {
            m_cachePos = mxParaStyles->getByName( aName );
            return true;
        }
        else
        {
            const uno::Sequence< OUString > sElementNames = mxParaStyles->getElementNames();
            auto pStyleName = std::find_if(sElementNames.begin(), sElementNames.end(),
                [&aName](const OUString& rStyleName) { return rStyleName.equalsIgnoreAsciiCase( aName ); });
            if (pStyleName != sElementNames.end())
            {
                m_cachePos = mxParaStyles->getByName( *pStyleName );
                return true;
            }
        }
        return false;
    }

    // XIndexAccess
    virtual ::sal_Int32 SAL_CALL getCount(  ) override
    {
        return mxParaStyles->getCount();
    }
    virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override
    {
        if ( Index < 0 || Index >= getCount() )
            throw lang::IndexOutOfBoundsException();

        return mxParaStyles->getByIndex( Index );
    }
    // XEnumerationAccess
    virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration(  ) override
    {
        throw uno::RuntimeException(u"Not implemented"_ustr );
    }
};

class StylesEnumWrapper : public EnumerationHelper_BASE
{
    SwVbaStyles* m_pStyles;
    sal_Int32 m_nIndex;
public:
    explicit StylesEnumWrapper( SwVbaStyles* _pStyles ) : m_pStyles( _pStyles ), m_nIndex( 1 ) {}
    virtual sal_Bool SAL_CALL hasMoreElements(  ) override
    {
        return ( m_nIndex <= m_pStyles->getCount() );
    }

    virtual uno::Any SAL_CALL nextElement(  ) override
    {
        if ( m_nIndex <= m_pStyles->getCount() )
            return m_pStyles->Item( uno::Any( m_nIndex++ ), uno::Any() );
        throw container::NoSuchElementException();
    }
};

}

SwVbaStyles::SwVbaStyles( const uno::Reference< XHelperInterface >& xParent,
                          const uno::Reference< css::uno::XComponentContext > & xContext,
                          const rtl::Reference< SwXTextDocument >& xModel )
    : SwVbaStyles_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new StyleCollectionHelper( xModel ) ) ),
      mxModel( xModel )
{
}

uno::Any
SwVbaStyles::createCollectionObject(const uno::Any& aObject)
{
    uno::Reference< beans::XPropertySet > xStyleProp( aObject, uno::UNO_QUERY_THROW );
    return uno::Any( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, mxModel, xStyleProp ) ) );
}

uno::Type SAL_CALL
SwVbaStyles::getElementType()
{
    return cppu::UnoType<word::XStyle>::get();
}

uno::Reference< container::XEnumeration > SAL_CALL
SwVbaStyles::createEnumeration()
{
    return new StylesEnumWrapper( this );
}

uno::Any SAL_CALL
SwVbaStyles::Item( const uno::Any& Index1, const uno::Any& Index2 )
{
    //handle WdBuiltinStyle
    sal_Int32 nIndex = 0;
    if( ( Index1 >>= nIndex ) && ( nIndex < 0 ) )
    {
        for( const BuiltinStyleTable* pTable = aBuiltinStyleTable; pTable != nullptr; pTable++ )
        {
            if( nIndex == pTable->wdBuiltinStyle )
            {
                OUString aStyleName = OUString::createFromAscii( pTable->pOOoStyleName );
                if( !aStyleName.isEmpty() )
                {
                    OUString aStyleType;
                    switch( pTable->wdStyleType )
                    {
                        case word::WdStyleType::wdStyleTypeParagraph:
                        case word::WdStyleType::wdStyleTypeTable:
                        {
                            aStyleType = "ParagraphStyles";
                            break;
                        }
                        case word::WdStyleType::wdStyleTypeCharacter:
                        {
                            aStyleType = "CharacterStyles";
                            break;
                        }
                        case word::WdStyleType::wdStyleTypeList:
                        {
                            // should use Paragraph style and set the property "NumberingStyleName"
                            aStyleType = "ParagraphStyles";
                            break;
                        }
                        default:
                            DebugHelper::basicexception( ERRCODE_BASIC_INTERNAL_ERROR, {} );
                    }
                    rtl::Reference< SwXStyleFamily > xStylesAccess( mxModel->getSwStyleFamilies()->GetStylesByName( aStyleType ) );
                    rtl::Reference< SwXBaseStyle > xStyleProps( xStylesAccess->getStyleByName( aStyleName ) );
                    // set the property "NumberingStyleName" if it is a listbullet
                    if( pTable->wdStyleType == word::WdStyleType::wdStyleTypeList )
                    {
                        xStyleProps->setPropertyValue(u"NumberingStyleName"_ustr, uno::Any( aStyleName ) );
                    }
                    return uno::Any( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, mxModel, xStyleProps ) ) );
                }
                else
                {
                    SAL_WARN("sw.vba", "the builtin style type is not implemented");
                    throw uno::RuntimeException(u"Not implemented"_ustr );
                }
            }
        }
    }
    return SwVbaStyles_BASE::Item( Index1, Index2 );
}

OUString
SwVbaStyles::getServiceImplName()
{
    return u"SwVbaStyles"_ustr;
}

uno::Sequence< OUString >
SwVbaStyles::getServiceNames()
{
    static uno::Sequence< OUString > const aServiceNames
    {
        u"ooo.vba.word.XStyles"_ustr
    };
    return aServiceNames;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


Messung V0.5 in Prozent
C=94 H=97 G=95

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.23Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.