LibreOffice Module sc (master)  1
vbatextframe.cxx
Go to the documentation of this file.
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 
20 #include <com/sun/star/drawing/XShape.hpp>
21 #include <sfx2/objsh.hxx>
22 #include "vbatextframe.hxx"
23 #include "vbacharacters.hxx"
24 
25 using namespace ::ooo::vba;
26 using namespace ::com::sun::star;
27 
28 ScVbaTextFrame::ScVbaTextFrame( uno::Sequence< uno::Any> const & args, uno::Reference< uno::XComponentContext> const & xContext ) : ScVbaTextFrame_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< drawing::XShape >( args, 1, false ) )
29 {
30 }
31 
32 // Methods
33 uno::Any SAL_CALL
35 {
36  uno::Reference< text::XSimpleText > xSimpleText( m_xShape, uno::UNO_QUERY_THROW );
38  uno::Any aStart( sal_Int32( 1 ) );
39  uno::Any aLength(sal_Int32( -1 ) );
40  return uno::makeAny( uno::Reference< ov::excel::XCharacters >( new ScVbaCharacters( this, mxContext, aPalette, xSimpleText, aStart, aLength, true ) ) );
41 }
42 
43 OUString
45 {
46  return "ScVbaTextFrame";
47 }
48 
49 uno::Sequence< OUString >
51 {
52  static uno::Sequence< OUString > const aServiceNames
53  {
54  "ooo.vba.excel.TextFrame"
55  };
56  return aServiceNames;
57 }
58 
59 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
61  css::uno::XComponentContext *context,
62  css::uno::Sequence<css::uno::Any> const &arguments)
63 {
64  return cppu::acquire(new ScVbaTextFrame(arguments, context));
65 }
66 
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< T > getXSomethingFromArgs(css::uno::Sequence< css::uno::Any > const &args, sal_Int32 nPos, bool bCanBeNull=true)
uno::Reference< uno::XComponentContext > mxContext
Sequence< OUString > aServiceNames
static SfxObjectShell * Current()
ScVbaTextFrame(css::uno::Sequence< css::uno::Any > const &aArgs, css::uno::Reference< css::uno::XComponentContext > const &xContext)
virtual OUString getServiceImplName() override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual css::uno::Any SAL_CALL Characters() override
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * ScVbaTextFrame_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &arguments)
cppu::ImplInheritanceHelper< VbaTextFrame, ov::excel::XTextFrame > ScVbaTextFrame_BASE