1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <docufld.hxx>
21 #include <unofldmid.h>
22 #include <strings.hrc>
23 #include <o3tl/any.hxx>
24 #include <swtypes.hxx>
27 using namespace ::com::sun::star
;
29 SwScriptFieldType::SwScriptFieldType( SwDoc
& rD
)
30 : SwFieldType( SwFieldIds::Script
), m_rDoc( rD
)
33 std::unique_ptr
<SwFieldType
> SwScriptFieldType::Copy() const
35 return std::make_unique
<SwScriptFieldType
>( m_rDoc
);
38 SwScriptField::SwScriptField( SwScriptFieldType
* pInitType
,
39 OUString aType
, OUString aCode
,
41 : SwField( pInitType
), m_sType( std::move(aType
) ), m_sCode( std::move(aCode
) ), m_bCodeURL( bURL
)
45 OUString
SwScriptField::GetDescription() const
47 return SwResId(STR_SCRIPT
);
50 OUString
SwScriptField::ExpandImpl(SwRootFrame
const*const) const
55 std::unique_ptr
<SwField
> SwScriptField::Copy() const
57 return std::make_unique
<SwScriptField
>( static_cast<SwScriptFieldType
*>(GetTyp()), m_sType
, m_sCode
, m_bCodeURL
);
61 void SwScriptField::SetPar1( const OUString
& rStr
)
66 OUString
SwScriptField::GetPar1() const
72 void SwScriptField::SetPar2( const OUString
& rStr
)
77 OUString
SwScriptField::GetPar2() const
82 bool SwScriptField::QueryValue( uno::Any
& rAny
, sal_uInt16 nWhichId
) const
92 case FIELD_PROP_BOOL1
:
101 bool SwScriptField::PutValue( const uno::Any
& rAny
, sal_uInt16 nWhichId
)
105 case FIELD_PROP_PAR1
:
108 case FIELD_PROP_PAR2
:
111 case FIELD_PROP_BOOL1
:
112 m_bCodeURL
= *o3tl::doAccess
<bool>(rAny
);
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */