Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #include <vbahelper/helperdecl.hxx>
20 : #include <com/sun/star/drawing/TextFitToSizeType.hpp>
21 : #include <com/sun/star/text/XText.hpp>
22 : #include "vbatextframe.hxx"
23 : #include "vbacharacters.hxx"
24 :
25 : using namespace ::ooo::vba;
26 : using namespace ::com::sun::star;
27 :
28 0 : ScVbaTextFrame::ScVbaTextFrame( uno::Sequence< uno::Any> const & args, uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : ScVbaTextFrame_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< drawing::XShape >( args, 1, false ) )
29 : {
30 0 : }
31 :
32 : // Methods
33 : uno::Any SAL_CALL
34 0 : ScVbaTextFrame::Characters() throw (uno::RuntimeException)
35 : {
36 0 : uno::Reference< text::XSimpleText > xSimpleText( m_xShape, uno::UNO_QUERY_THROW );
37 0 : ScVbaPalette aPalette( SfxObjectShell::Current() );
38 0 : uno::Any aStart( sal_Int32( 1 ) );
39 0 : uno::Any aLength(sal_Int32( -1 ) );
40 0 : return uno::makeAny( uno::Reference< ov::excel::XCharacters >( new ScVbaCharacters( this, mxContext, aPalette, xSimpleText, aStart, aLength, sal_True ) ) );
41 : }
42 :
43 : rtl::OUString
44 0 : ScVbaTextFrame::getServiceImplName()
45 : {
46 0 : return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaTextFrame"));
47 : }
48 :
49 : uno::Sequence< rtl::OUString >
50 0 : ScVbaTextFrame::getServiceNames()
51 : {
52 0 : static uno::Sequence< rtl::OUString > aServiceNames;
53 0 : if ( aServiceNames.getLength() == 0 )
54 : {
55 0 : aServiceNames.realloc( 1 );
56 0 : aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.TextFrame" ) );
57 : }
58 0 : return aServiceNames;
59 : }
60 :
61 : namespace textframe
62 : {
63 : namespace sdecl = comphelper::service_decl;
64 0 : sdecl::vba_service_class_<ScVbaTextFrame, sdecl::with_args<true> > serviceImpl;
65 0 : extern sdecl::ServiceDecl const serviceDecl(
66 : serviceImpl,
67 : "ScVbaTextFrame",
68 : "ooo.vba.excel.TextFrame" );
69 0 : }
70 :
71 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|