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 :
20 :
21 : #include <sfx2/sfxsids.hrc>
22 : #include "sorgitm.hxx"
23 : #include <osl/diagnose.h>
24 :
25 : // STATIC DATA -----------------------------------------------------------
26 :
27 216 : TYPEINIT1_AUTOFACTORY(SfxScriptOrganizerItem, SfxStringItem);
28 :
29 :
30 :
31 0 : SfxScriptOrganizerItem::SfxScriptOrganizerItem() :
32 :
33 0 : SfxStringItem()
34 :
35 : {
36 0 : }
37 :
38 :
39 :
40 0 : SfxScriptOrganizerItem::SfxScriptOrganizerItem( const SfxScriptOrganizerItem& rItem ) :
41 :
42 : SfxStringItem( rItem ),
43 :
44 0 : aLanguage( rItem.aLanguage )
45 :
46 : {
47 0 : }
48 :
49 :
50 :
51 0 : SfxScriptOrganizerItem::~SfxScriptOrganizerItem()
52 : {
53 0 : }
54 :
55 :
56 :
57 0 : SfxPoolItem* SfxScriptOrganizerItem::Clone( SfxItemPool * ) const
58 : {
59 0 : return new SfxScriptOrganizerItem( *this );
60 : }
61 :
62 :
63 :
64 0 : bool SfxScriptOrganizerItem::operator==( const SfxPoolItem& rItem) const
65 : {
66 0 : return rItem.Type() == Type() &&
67 0 : SfxStringItem::operator==(rItem) &&
68 0 : aLanguage == static_cast<const SfxScriptOrganizerItem &>(rItem).aLanguage;
69 : }
70 :
71 :
72 0 : bool SfxScriptOrganizerItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
73 : {
74 0 : OUString aValue;
75 0 : nMemberId &= ~CONVERT_TWIPS;
76 0 : switch ( nMemberId )
77 : {
78 : case 0:
79 : case MID_SCRIPT_ORGANIZER_LANGUAGE:
80 0 : aValue = aLanguage;
81 0 : break;
82 : default:
83 : OSL_FAIL("Wrong MemberId!");
84 0 : return false;
85 : }
86 :
87 0 : rVal <<= aValue;
88 :
89 0 : return true;
90 : }
91 :
92 0 : bool SfxScriptOrganizerItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
93 : {
94 0 : OUString aValue;
95 0 : bool bRet = false;
96 0 : nMemberId &= ~CONVERT_TWIPS;
97 0 : switch ( nMemberId )
98 : {
99 : case 0:
100 : case MID_SCRIPT_ORGANIZER_LANGUAGE:
101 0 : bRet = (rVal >>= aValue);
102 0 : if ( bRet )
103 0 : aLanguage = aValue;
104 0 : break;
105 : default:
106 : OSL_FAIL("Wrong MemberId!");
107 0 : return false;
108 : }
109 :
110 0 : return bRet;
111 : }
112 :
113 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|